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

View File

@ -1,6 +1,8 @@
{ lib, modulesPath, ... }: { lib, modulesPath, ... }:
{ {
sbruder.machine.isVm = true;
boot = { boot = {
kernelModules = [ ]; kernelModules = [ ];
extraModulePackages = [ ]; 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") (modulesPath + "/profiles/qemu-guest.nix")
]; ];
sbruder.machine.isVm = true;
boot = { boot = {
kernelModules = [ ]; kernelModules = [ ];
extraModulePackages = [ ]; 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") (modulesPath + "/profiles/qemu-guest.nix")
]; ];
sbruder.machine.isVm = true;
boot = { boot = {
kernelParams = [ "ip=dhcp" ]; kernelParams = [ "ip=dhcp" ];
initrd = { 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; }; trusted = (lib.mkEnableOption "the trusted status of this machine (i.e. encrypted root)") // { default = true; };
gui.enable = lib.mkEnableOption "gui"; 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 # All modules are imported but non-essential modules are activated by
@ -87,8 +94,6 @@
# command-not-found does not work without channels # command-not-found does not work without channels
programs.command-not-found.enable = false; programs.command-not-found.enable = false;
# Hard drive monitoring
services.smartd.enable = lib.mkDefault true;
# Network monitoring # Network monitoring
services.vnstat.enable = true; services.vnstat.enable = true;
environment.etc."vnstat.conf".text = '' environment.etc."vnstat.conf".text = ''
@ -146,8 +151,11 @@
''; '';
}; };
} }
(lib.mkIf config.sbruder.full { (lib.mkIf (!config.sbruder.machine.isVm) {
services.fwupd.enable = true; # Hard drive monitoring
services.smartd.enable = lib.mkDefault true;
# Firmware updates
services.fwupd.enable = lib.mkDefault true;
}) })
(lib.mkIf (!config.sbruder.full) { (lib.mkIf (!config.sbruder.full) {
documentation.enable = lib.mkDefault false; documentation.enable = lib.mkDefault false;