diff --git a/hosts/ni/default.nix b/hosts/ni/default.nix index f2416fea..712306a0 100644 --- a/hosts/ni/default.nix +++ b/hosts/ni/default.nix @@ -26,6 +26,7 @@ ]; hosts.ni = { + hardware.qol.enable = true; networking.setup = "networkmanager"; networking.wireguard.enable = true; }; diff --git a/hosts/ni/hardware-configuration.nix b/hosts/ni/hardware-configuration.nix index 450e68b9..1a424ca8 100644 --- a/hosts/ni/hardware-configuration.nix +++ b/hosts/ni/hardware-configuration.nix @@ -47,31 +47,10 @@ powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; hardware.cpu.intel.updateMicrocode = lib.mkDefault true; - # We're using some better filesystems so we're using it. - boot.initrd.supportedFilesystems = [ "btrfs" ]; - boot.supportedFilesystems = [ "btrfs" ]; - services.btrfs.autoScrub = { enable = true; fileSystems = [ "/mnt/archives" ]; }; - - # Set up printers. - services.printing = { - enable = true; - browsing = true; - drivers = with pkgs; [ - gutenprint - hplip - splix - ]; - }; - - # Make your CPU more useful. - services.auto-cpufreq.enable = true; - - # Extend the life of an SSD. - services.fstrim.enable = true; } diff --git a/hosts/ni/modules/default.nix b/hosts/ni/modules/default.nix index 2dfff773..cfa7996e 100644 --- a/hosts/ni/modules/default.nix +++ b/hosts/ni/modules/default.nix @@ -1,6 +1,7 @@ # Only optional modules should be imported here. { imports = [ + ./hardware/qol.nix ./networking/setup.nix ./networking/wireguard.nix ]; diff --git a/hosts/ni/modules/hardware/qol.nix b/hosts/ni/modules/hardware/qol.nix new file mode 100644 index 00000000..5bd33682 --- /dev/null +++ b/hosts/ni/modules/hardware/qol.nix @@ -0,0 +1,33 @@ +# Some quality-of-life features for your hardware. +{ config, lib, pkgs, ... }: + +let + hostCfg = config.hosts.ni; + cfg = hostCfg.hardware.qol; +in +{ + options.hosts.ni.hardware.qol.enable = lib.mkEnableOption "quality-of-life hardware features"; + + config = lib.mkIf cfg.enable { + # We're using some better filesystems so we're using it. + boot.initrd.supportedFilesystems = [ "btrfs" ]; + boot.supportedFilesystems = [ "btrfs" ]; + + # Set up printers. + services.printing = { + enable = true; + browsing = true; + drivers = with pkgs; [ + gutenprint + hplip + splix + ]; + }; + + # Make your CPU more useful. + services.auto-cpufreq.enable = true; + + # Extend the life of an SSD. + services.fstrim.enable = true; + }; +}