From 3fdc0bcec3e16e2b0277d7e311c9ee683f3aa30c Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Wed, 21 Feb 2024 02:17:54 +0300 Subject: [PATCH] System : Another attempt to drop HW configs. --- .config/linux/system/flake.nix | 4 +- .../host/dasha/HardwareConfiguration.nix | 37 ----------------- .../system/host/fsight/Configuration.nix | 3 +- .../host/fsight/HardwareConfiguration.nix | 27 ------------- .../host/home/HardwareConfiguration.nix | 37 ----------------- .../host/laptop/HardwareConfiguration.nix | 38 ------------------ .../host/live/HardwareConfiguration.nix | 2 - .../host/work/HardwareConfiguration.nix | 40 ------------------- .config/linux/system/module/IntelCpu.nix | 3 ++ .../linux/system/module/common/Bootloader.nix | 12 ++++++ 10 files changed, 19 insertions(+), 184 deletions(-) delete mode 100644 .config/linux/system/host/dasha/HardwareConfiguration.nix delete mode 100644 .config/linux/system/host/fsight/HardwareConfiguration.nix delete mode 100644 .config/linux/system/host/home/HardwareConfiguration.nix delete mode 100644 .config/linux/system/host/laptop/HardwareConfiguration.nix delete mode 100644 .config/linux/system/host/live/HardwareConfiguration.nix delete mode 100644 .config/linux/system/host/work/HardwareConfiguration.nix create mode 100644 .config/linux/system/module/IntelCpu.nix diff --git a/.config/linux/system/flake.nix b/.config/linux/system/flake.nix index d9d55d5..46257db 100644 --- a/.config/linux/system/flake.nix +++ b/.config/linux/system/flake.nix @@ -55,6 +55,7 @@ ./module/AmdGpu.nix ./module/Flatpak.nix ./module/Gnome.nix + ./module/IntelCpu.nix ./module/PowersaveIntel.nix ./module/Print.nix ./user/Dasha.nix @@ -132,8 +133,9 @@ modules = [ ./module/Flatpak.nix ./module/Gnome.nix - ./module/PowersaveIntel.nix + ./module/IntelCpu.nix ./module/Powerlimit.nix + ./module/PowersaveIntel.nix ./module/Print.nix ./user/Voronind.nix ]; diff --git a/.config/linux/system/host/dasha/HardwareConfiguration.nix b/.config/linux/system/host/dasha/HardwareConfiguration.nix deleted file mode 100644 index e82b6da..0000000 --- a/.config/linux/system/host/dasha/HardwareConfiguration.nix +++ /dev/null @@ -1,37 +0,0 @@ -# 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, ... }: - -{ - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ]; - boot.initrd.kernelModules = [ "dm-snapshot" ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/055f4205-5cdc-4a0b-b71f-fcd90125a1cb"; - fsType = "ext4"; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/03A6-E2B8"; - fsType = "vfat"; - }; - - swapDevices = [ ]; - - # 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 - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp4s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/.config/linux/system/host/fsight/Configuration.nix b/.config/linux/system/host/fsight/Configuration.nix index 95a39f8..4443e72 100644 --- a/.config/linux/system/host/fsight/Configuration.nix +++ b/.config/linux/system/host/fsight/Configuration.nix @@ -1,6 +1,5 @@ { lib, ... }: { - imports = [ - ]; + imports = [ ]; # Grub. boot.loader.systemd-boot.enable = lib.mkForce false; diff --git a/.config/linux/system/host/fsight/HardwareConfiguration.nix b/.config/linux/system/host/fsight/HardwareConfiguration.nix deleted file mode 100644 index 222c948..0000000 --- a/.config/linux/system/host/fsight/HardwareConfiguration.nix +++ /dev/null @@ -1,27 +0,0 @@ -# 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, ... }: - -{ - imports = [ ]; - - boot.initrd.availableKernelModules = [ "ata_piix" "mptspi" "sd_mod" "sr_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/a0a14d13-561e-4182-8a9a-4ef2c5be1b8b"; - fsType = "ext4"; - }; - - - # 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 - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - # networking.interfaces.ens32.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; -} diff --git a/.config/linux/system/host/home/HardwareConfiguration.nix b/.config/linux/system/host/home/HardwareConfiguration.nix deleted file mode 100644 index e2e32a1..0000000 --- a/.config/linux/system/host/home/HardwareConfiguration.nix +++ /dev/null @@ -1,37 +0,0 @@ -# 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, ... }: - -{ - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ "dm-snapshot" ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/45529e37-2d51-45c7-be5a-933294d652e2"; - fsType = "ext4"; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/F1D6-267D"; - fsType = "vfat"; - }; - - swapDevices = [ ]; - - # 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 - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp7s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/.config/linux/system/host/laptop/HardwareConfiguration.nix b/.config/linux/system/host/laptop/HardwareConfiguration.nix deleted file mode 100644 index ea10be2..0000000 --- a/.config/linux/system/host/laptop/HardwareConfiguration.nix +++ /dev/null @@ -1,38 +0,0 @@ -# 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, ... }: - -{ - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/a3ecc55c-8c7d-4307-9c4f-478201e496b2"; - fsType = "ext4"; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/61B7-2F83"; - fsType = "vfat"; - }; - - swapDevices = [ ]; - - # 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 - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp5s0.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/.config/linux/system/host/live/HardwareConfiguration.nix b/.config/linux/system/host/live/HardwareConfiguration.nix deleted file mode 100644 index 4b2c5c4..0000000 --- a/.config/linux/system/host/live/HardwareConfiguration.nix +++ /dev/null @@ -1,2 +0,0 @@ -{ ... }: { -} diff --git a/.config/linux/system/host/work/HardwareConfiguration.nix b/.config/linux/system/host/work/HardwareConfiguration.nix deleted file mode 100644 index e31c2e1..0000000 --- a/.config/linux/system/host/work/HardwareConfiguration.nix +++ /dev/null @@ -1,40 +0,0 @@ -# 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, ... }: - -{ - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/a5ab4094-9727-4703-809c-0a5bb8eb9505"; - fsType = "ext4"; - }; - - boot.initrd.luks.devices."luks-73677265-6a4e-458b-ae0f-cb8fcf05228f".device = "/dev/disk/by-uuid/73677265-6a4e-458b-ae0f-cb8fcf05228f"; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/183E-F191"; - fsType = "vfat"; - }; - - swapDevices = [ ]; - - # 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 - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/.config/linux/system/module/IntelCpu.nix b/.config/linux/system/module/IntelCpu.nix new file mode 100644 index 0000000..4fce603 --- /dev/null +++ b/.config/linux/system/module/IntelCpu.nix @@ -0,0 +1,3 @@ +{ ... }: { + boot.kernelModules = [ "kvm-intel" ]; +} diff --git a/.config/linux/system/module/common/Bootloader.nix b/.config/linux/system/module/common/Bootloader.nix index 49cd2ce..e6c2724 100644 --- a/.config/linux/system/module/common/Bootloader.nix +++ b/.config/linux/system/module/common/Bootloader.nix @@ -1,4 +1,16 @@ { ... }: { boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.initrd.availableKernelModules = [ + "ahci" + "ata_piix" + "mptspi" + "nvme" + "sd_mod" + "sr_mod" + "usb_storage" + "usbhid" + "xhci_pci" + ]; }