From 10790f87a4f8dd06f5538a033de660fe7226230b Mon Sep 17 00:00:00 2001 From: C4 Patino Date: Sat, 2 May 2026 12:35:15 -0500 Subject: [PATCH] refactor: collapsed configuration blocks with shared prefixes into nested format --- .../chibi/hardware-configuration.nix | 18 ++++--- .../arisu/hardware-configuration.nix | 28 +++++++---- .../kokoro/hardware-configuration.nix | 47 ++++++++++++------- .../shiori/hardware-configuration.nix | 23 +++++++-- .../tobira/hardware-configuration.nix | 23 +++++++-- 5 files changed, 97 insertions(+), 42 deletions(-) diff --git a/systems/aarch64-linux/chibi/hardware-configuration.nix b/systems/aarch64-linux/chibi/hardware-configuration.nix index c1ed8e0..29d0114 100755 --- a/systems/aarch64-linux/chibi/hardware-configuration.nix +++ b/systems/aarch64-linux/chibi/hardware-configuration.nix @@ -10,12 +10,18 @@ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = ["xhci_pci"]; - boot.initrd.kernelModules = []; - boot.kernelModules = []; - boot.kernelParams = ["cgroup_enable=memory" "swapaccount=1"]; - boot.extraModulePackages = []; - boot.initrd.systemd.tpm2.enable = false; + boot = { + kernelModules = []; + kernelParams = ["cgroup_enable=memory" "swapaccount=1"]; + extraModulePackages = []; + + initrd = { + availableKernelModules = ["xhci_pci"]; + kernelModules = []; + + systemd.tpm2.enable = false; + }; + }; swapDevices = []; diff --git a/systems/x86_64-linux/arisu/hardware-configuration.nix b/systems/x86_64-linux/arisu/hardware-configuration.nix index cfaf15d..6d568e4 100644 --- a/systems/x86_64-linux/arisu/hardware-configuration.nix +++ b/systems/x86_64-linux/arisu/hardware-configuration.nix @@ -12,15 +12,25 @@ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid"]; - boot.initrd.kernelModules = []; - boot.kernelModules = [ - "kvm-amd" - "v4l2loopback" - ]; - boot.extraModulePackages = with pkgs.linuxPackages; [ - v4l2loopback - ]; + boot = { + kernelModules = [ + "kvm-amd" + "v4l2loopback" + ]; + extraModulePackages = with pkgs.linuxPackages; [ + v4l2loopback + ]; + + initrd = { + availableKernelModules = [ + "ahci" + "nvme" + "usbhid" + "xhci_pci" + ]; + kernelModules = []; + }; + }; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/systems/x86_64-linux/kokoro/hardware-configuration.nix b/systems/x86_64-linux/kokoro/hardware-configuration.nix index bad24a9..7113651 100644 --- a/systems/x86_64-linux/kokoro/hardware-configuration.nix +++ b/systems/x86_64-linux/kokoro/hardware-configuration.nix @@ -13,25 +13,38 @@ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = ["xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod"]; - boot.initrd.kernelModules = []; - boot.kernelPackages = pkgs.linuxPackages_latest; - boot.kernelModules = [ - "imx471" - "kvm-intel" - "v4l2loopback" - ]; - boot.extraModulePackages = with pkgs.linuxPackages_latest; [ - imx471 - v4l2loopback - ]; - boot.extraModprobeConfig = '' - options v4l2loopback devices=1 video_nr=0 card_label="IMX471 Virtual Camera" exclusive_caps=1 - ''; + boot = { + kernelPackages = pkgs.linuxPackages_latest; + kernelModules = [ + "imx471" + "kvm-intel" + "v4l2loopback" + ]; + extraModulePackages = with pkgs.linuxPackages_latest; [ + imx471 + v4l2loopback + ]; + extraModprobeConfig = '' + options v4l2loopback devices=1 video_nr=0 card_label="IMX471 Virtual Camera" exclusive_caps=1 + ''; + + initrd = { + availableKernelModules = [ + "nvme" + "sd_mod" + "thunderbolt" + "usb_storage" + "xhci_pci" + ]; + kernelModules = []; + }; + }; services.logind.settings.Login.HandleLidSwitchExternalPower = "ignore"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.npu.enable = true; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.cpu.intel = { + npu.enable = true; + updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + }; } diff --git a/systems/x86_64-linux/shiori/hardware-configuration.nix b/systems/x86_64-linux/shiori/hardware-configuration.nix index 478c2eb..3bd7648 100755 --- a/systems/x86_64-linux/shiori/hardware-configuration.nix +++ b/systems/x86_64-linux/shiori/hardware-configuration.nix @@ -11,11 +11,24 @@ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"]; - boot.initrd.kernelModules = []; - boot.kernelModules = ["kvm-intel"]; - boot.extraModulePackages = []; - boot.initrd.systemd.tpm2.enable = false; + boot = { + kernelModules = ["kvm-intel"]; + extraModulePackages = []; + + initrd = { + availableKernelModules = [ + "ahci" + "sd_mod" + "sdhci_pci" + "usb_storage" + "usbhid" + "xhci_pci" + ]; + kernelModules = []; + + systemd.tpm2.enable = false; + }; + }; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/systems/x86_64-linux/tobira/hardware-configuration.nix b/systems/x86_64-linux/tobira/hardware-configuration.nix index 478c2eb..318003d 100755 --- a/systems/x86_64-linux/tobira/hardware-configuration.nix +++ b/systems/x86_64-linux/tobira/hardware-configuration.nix @@ -11,11 +11,24 @@ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"]; - boot.initrd.kernelModules = []; - boot.kernelModules = ["kvm-intel"]; - boot.extraModulePackages = []; - boot.initrd.systemd.tpm2.enable = false; + boot = { + kernelModules = ["kvm-intel"]; + extraModulePackages = []; + + initrd = { + availableKernelModules = [ + "xhci_pci" + "ahci" + "usbhid" + "usb_storage" + "sd_mod" + "sdhci_pci" + ]; + kernelModules = []; + + systemd.tpm2.enable = false; + }; + }; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's