From d8c7033a48387ec1f628f69e56e4bd8d95c20c42 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 6 Nov 2023 16:13:04 +0800 Subject: [PATCH] hosts/ni: modularize more parts of hardware config --- hosts/ni/default.nix | 15 --------------- hosts/ni/hardware-configuration.nix | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/hosts/ni/default.nix b/hosts/ni/default.nix index 3f219320..d8eb77e3 100644 --- a/hosts/ni/default.nix +++ b/hosts/ni/default.nix @@ -67,26 +67,12 @@ # The keyfile required for the secrets to be decrypted. sops.age.keyFile = "/var/lib/sops-nix/key.txt"; - # Get the latest kernel for the desktop experience. - boot.kernelPackages = pkgs.linuxPackages_latest; - # Adding a bunch of emulated systems for cross-system building. boot.binfmt.emulatedSystems = [ "aarch64-linux" "riscv64-linux" ]; - # 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" - ]; - }; - # My custom configuration with my custom modules starts here. profiles = { i18n.enable = true; @@ -170,6 +156,5 @@ longitude = 121.0; }; - services.auto-cpufreq.enable = true; system.stateVersion = "23.11"; # Yes! I read the comment! } diff --git a/hosts/ni/hardware-configuration.nix b/hosts/ni/hardware-configuration.nix index 40c2b704..c0f1dd58 100644 --- a/hosts/ni/hardware-configuration.nix +++ b/hosts/ni/hardware-configuration.nix @@ -6,6 +6,9 @@ ./modules/hardware/traditional-networking.nix ]; + # Get the latest kernel for the desktop experience. + boot.kernelPackages = pkgs.linuxPackages_latest; + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "uas" "sd_mod" ]; boot.initrd.kernelModules = [ ]; @@ -45,6 +48,17 @@ 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; @@ -56,6 +70,9 @@ ]; }; + # Make your CPU more useful. + services.auto-cpufreq.enable = true; + # Extend the life of an SSD. services.fstrim.enable = true; }