Do not enable fwupd on virtual machines

It only uses up resources on those hosts but serves no purpose.
yuzuru2
Simon Bruder 2024-01-01 16:11:28 +01:00
parent faf159bb66
commit 2a5da89f53
Signed by: simon
GPG Key ID: 8D3C82F9F309F8EC
5 changed files with 20 additions and 16 deletions

View File

@ -5,6 +5,8 @@
(modulesPath + "/profiles/qemu-guest.nix")
];
sbruder.machine.isVm = true;
boot = {
kernelParams = [ "ip=86.106.183.111/26::86.106.183.65::nazuna" ];
initrd = {
@ -50,7 +52,4 @@
};
};
};
# no smart on qemu disk
services.smartd.enable = false;
}

View File

@ -1,6 +1,8 @@
{ lib, modulesPath, ... }:
{
sbruder.machine.isVm = true;
boot = {
kernelModules = [ ];
extraModulePackages = [ ];
@ -65,7 +67,4 @@
};
};
};
# no smart on virtual disk
services.smartd.enable = false;
}

View File

@ -5,6 +5,8 @@
(modulesPath + "/profiles/qemu-guest.nix")
];
sbruder.machine.isVm = true;
boot = {
kernelModules = [ ];
extraModulePackages = [ ];
@ -66,7 +68,4 @@
};
};
};
# no smart on qemu disk
services.smartd.enable = false;
}

View File

@ -5,6 +5,8 @@
(modulesPath + "/profiles/qemu-guest.nix")
];
sbruder.machine.isVm = true;
boot = {
kernelParams = [ "ip=dhcp" ];
initrd = {
@ -45,7 +47,4 @@
};
};
};
# no smart on qemu disk
services.smartd.enable = false;
}

View File

@ -13,6 +13,13 @@
};
trusted = (lib.mkEnableOption "the trusted status of this machine (i.e. encrypted root)") // { default = true; };
gui.enable = lib.mkEnableOption "gui";
machine = {
isVm = lib.mkOption {
type = lib.types.bool;
description = "Whether this machine is a virtual machine.";
default = false;
};
};
};
# All modules are imported but non-essential modules are activated by
@ -87,8 +94,6 @@
# command-not-found does not work without channels
programs.command-not-found.enable = false;
# Hard drive monitoring
services.smartd.enable = lib.mkDefault true;
# Network monitoring
services.vnstat.enable = true;
environment.etc."vnstat.conf".text = ''
@ -146,8 +151,11 @@
'';
};
}
(lib.mkIf config.sbruder.full {
services.fwupd.enable = true;
(lib.mkIf (!config.sbruder.machine.isVm) {
# Hard drive monitoring
services.smartd.enable = lib.mkDefault true;
# Firmware updates
services.fwupd.enable = lib.mkDefault true;
})
(lib.mkIf (!config.sbruder.full) {
documentation.enable = lib.mkDefault false;