From 70e1f0eaf74b8427804be3c0f2ba84fef0fa0127 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 17 Apr 2025 09:53:05 +0200 Subject: [PATCH] refactor: restructure hardware configuration file Reformatted the hardware configuration file for improved clarity and organization. Consolidated nested attributes and adjusted formatting to align with best practices. --- .../x1/hardware-configuration.nix | 96 ++++++++++--------- 1 file changed, 49 insertions(+), 47 deletions(-) diff --git a/systems/x86_64-linux/x1/hardware-configuration.nix b/systems/x86_64-linux/x1/hardware-configuration.nix index f380e71..2b18eae 100644 --- a/systems/x86_64-linux/x1/hardware-configuration.nix +++ b/systems/x86_64-linux/x1/hardware-configuration.nix @@ -1,64 +1,66 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ - config, - lib, - pkgs, - modulesPath, - ... +{ config +, lib +, pkgs +, modulesPath +, ... }: { imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + boot = { + initrd.availableKernelModules = [ + "thunderbolt" + "nvme" + "uas" + "usbhid" + "sd_mod" + ]; + initrd.kernelModules = [ ]; + kernelPackages = lib.mkOverride 0 pkgs.linuxPackages_latest; + kernelModules = [ + "kvm-intel" + "amdgpu" + ]; + kernelParams = [ + "lockdown=confidentiality" + "intel_iommu=on" + "quiet" + "splash" + "video=efifb:nobgrt" + ]; - boot.initrd.availableKernelModules = [ - "thunderbolt" - "nvme" - "uas" - "usbhid" - "sd_mod" - ]; - boot.initrd.kernelModules = [ ]; - #boot.kernelPackages = lib.mkOverride 0 pkgs.linuxPackages_latest; - boot.kernelModules = [ - "kvm-intel" - "amdgpu" - ]; - boot.kernelParams = [ - "lockdown=confidentiality" - "intel_iommu=on" - "quiet" - "splash" - "video=efifb:nobgrt" - ]; + extraModulePackages = [ ]; - boot.extraModulePackages = [ ]; + initrd.luks.devices."luks-0e2792db-1b80-49a7-b2eb-54e4b5fc3502" = { + device = "/dev/disk/by-uuid/0e2792db-1b80-49a7-b2eb-54e4b5fc3502"; + allowDiscards = true; + }; + + initrd.luks.devices."luks-280f2e07-e5fc-478e-b7ee-445c99bea415" = { + device = "/dev/disk/by-uuid/280f2e07-e5fc-478e-b7ee-445c99bea415"; + allowDiscards = true; + }; + }; services.btrfs.autoScrub.enable = true; - fileSystems."/" = { - device = "/dev/disk/by-uuid/1106202c-c3bf-4c15-b7cd-e78749e5c955"; - fsType = "btrfs"; - options = [ "subvol=@" ]; + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/1106202c-c3bf-4c15-b7cd-e78749e5c955"; + fsType = "btrfs"; + options = [ "subvol=@" ]; + }; + + "/boot" = { + device = "/dev/disk/by-uuid/13C4-A825"; + fsType = "vfat"; + }; }; - boot.initrd.luks.devices."luks-0e2792db-1b80-49a7-b2eb-54e4b5fc3502" = { - device = "/dev/disk/by-uuid/0e2792db-1b80-49a7-b2eb-54e4b5fc3502"; - allowDiscards = true; - }; - - boot.initrd.luks.devices."luks-280f2e07-e5fc-478e-b7ee-445c99bea415" = { - device = "/dev/disk/by-uuid/280f2e07-e5fc-478e-b7ee-445c99bea415"; - allowDiscards = true; - }; - - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/13C4-A825"; - fsType = "vfat"; - }; - - swapDevices = [ { device = "/dev/mapper/luks-280f2e07-e5fc-478e-b7ee-445c99bea415"; } ]; + swapDevices = [{ device = "/dev/mapper/luks-280f2e07-e5fc-478e-b7ee-445c99bea415"; }]; # 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