diff --git a/defaults/base/applications.nix b/defaults/base/applications.nix deleted file mode 100644 index 2829400..0000000 --- a/defaults/base/applications.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: - -{ - environment.systemPackages = - with pkgs; - [ - pciutils - dmidecode - smartmontools - iw - efibootmgr - efitools - efivar - pwgen - powertop - lm_sensors - ] - ++ [ - # Filesystem & Disk Utilities - hdparm - smartmontools - ] - ++ [ - # Networking Utilities - tcpdump - ]; -} diff --git a/defaults/base/default.nix b/defaults/base/default.nix deleted file mode 100644 index 7b21c01..0000000 --- a/defaults/base/default.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -{ - imports = [ - ./applications.nix - ]; - - # System Services - services.fwupd.enable = true; - - services.smartd = { - enable = true; - notifications.mail = { - enable = true; - mailer = "${pkgs.msmtp}/bin/sendmail"; - sender = "system@qo.is"; - recipient = "sysadmin@qo.is"; - }; - }; -} diff --git a/nixos-configurations/calanda/default.nix b/nixos-configurations/calanda/default.nix index dcc9bff..18bd0e2 100644 --- a/nixos-configurations/calanda/default.nix +++ b/nixos-configurations/calanda/default.nix @@ -7,10 +7,11 @@ ../../defaults/hardware/apu.nix - ../../defaults/base ../../defaults/meta ]; + qois.system.physical.enable = true; + # This value determines the NixOS release from which the default # settings for stateful data, like fi:le locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave diff --git a/nixos-configurations/cyprianspitz/default.nix b/nixos-configurations/cyprianspitz/default.nix index 66ff7e7..a306350 100644 --- a/nixos-configurations/cyprianspitz/default.nix +++ b/nixos-configurations/cyprianspitz/default.nix @@ -11,10 +11,11 @@ ../../defaults/hardware/asrock-z790m.nix - ../../defaults/base ../../defaults/meta ]; + qois.system.physical.enable = true; + # Set your time zone. time.timeZone = "Europe/Amsterdam"; diff --git a/nixos-configurations/lindberg/default.nix b/nixos-configurations/lindberg/default.nix index 74a84b6..6c26cca 100644 --- a/nixos-configurations/lindberg/default.nix +++ b/nixos-configurations/lindberg/default.nix @@ -12,10 +12,11 @@ ../../defaults/hardware/asrock.nix - ../../defaults/base ../../defaults/meta ]; + qois.system.physical.enable = true; + # Set your time zone. time.timeZone = "Europe/Amsterdam"; diff --git a/nixos-configurations/stompert/default.nix b/nixos-configurations/stompert/default.nix index e9b7249..7419b91 100644 --- a/nixos-configurations/stompert/default.nix +++ b/nixos-configurations/stompert/default.nix @@ -7,10 +7,12 @@ { imports = [ ../../defaults/hardware/apu.nix - ../../defaults/base + ../../defaults/meta ]; + qois.system.physical.enable = true; + boot.initrd.luks.devices."systems".device = "/dev/disk/by-uuid/5718bd19-cb7a-4728-9ec4-6b2be48215fc"; diff --git a/nixos-modules/system/default.nix b/nixos-modules/system/default.nix index 7fd1b21..ed0dfb5 100644 --- a/nixos-modules/system/default.nix +++ b/nixos-modules/system/default.nix @@ -9,6 +9,7 @@ imports = [ ./applications.nix ./overlays.nix + ./physical.nix ./security.nix ./unfree.nix ./virtual-machine.nix diff --git a/nixos-modules/system/physical.nix b/nixos-modules/system/physical.nix new file mode 100644 index 0000000..2597bde --- /dev/null +++ b/nixos-modules/system/physical.nix @@ -0,0 +1,52 @@ +{ + config, + lib, + pkgs, + ... +}: +let + cfg = config.qois.system.physical; +in +with lib; +{ + options.qois.system.physical.enable = mkEnableOption "Enable qois physical system configuration"; + + config = lib.mkIf cfg.enable { + environment.systemPackages = + with pkgs; + [ + pciutils + dmidecode + smartmontools + iw + efibootmgr + efitools + efivar + pwgen + powertop + lm_sensors + ] + ++ [ + # Filesystem & Disk Utilities + hdparm + smartmontools + ] + ++ [ + # Networking Utilities + tcpdump + ]; + + # System Services + services.fwupd.enable = true; + + services.smartd = { + enable = true; + notifications.mail = { + enable = true; + mailer = "${pkgs.msmtp}/bin/sendmail"; + sender = "system@qo.is"; + recipient = "sysadmin@qo.is"; + }; + }; + }; +}