diff --git a/machines/nazuna/hardware-configuration.nix b/machines/nazuna/hardware-configuration.nix index 8b1fcbf..6972f73 100644 --- a/machines/nazuna/hardware-configuration.nix +++ b/machines/nazuna/hardware-configuration.nix @@ -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; } diff --git a/machines/okarin/hardware-configuration.nix b/machines/okarin/hardware-configuration.nix index c507f4a..c83ce20 100644 --- a/machines/okarin/hardware-configuration.nix +++ b/machines/okarin/hardware-configuration.nix @@ -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; } diff --git a/machines/renge/hardware-configuration.nix b/machines/renge/hardware-configuration.nix index dc8f24f..2f23423 100644 --- a/machines/renge/hardware-configuration.nix +++ b/machines/renge/hardware-configuration.nix @@ -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; } diff --git a/machines/vueko/hardware-configuration.nix b/machines/vueko/hardware-configuration.nix index 51b0803..34929a9 100644 --- a/machines/vueko/hardware-configuration.nix +++ b/machines/vueko/hardware-configuration.nix @@ -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; } diff --git a/modules/default.nix b/modules/default.nix index 7373c26..4ad01d0 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -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;