From 567c698e7f20c1e1c375f8ee0bd7b078069cebbe Mon Sep 17 00:00:00 2001 From: Thomas Syms Date: Sun, 28 Jan 2024 11:57:09 -0400 Subject: [PATCH] Added hardware configuration to Pegasus --- flake.nix | 1 - hosts/Pegasus/default.nix | 31 +++--------------- hosts/Pegasus/hardware-configuration.nix | 41 ++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 28 deletions(-) create mode 100644 hosts/Pegasus/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index 131feaf..31817ef 100644 --- a/flake.nix +++ b/flake.nix @@ -125,7 +125,6 @@ ./home ./home/shell ./home/applications - ./home/desktops/gnome ]; }; } diff --git a/hosts/Pegasus/default.nix b/hosts/Pegasus/default.nix index 7bd96e6..4d8f53a 100644 --- a/hosts/Pegasus/default.nix +++ b/hosts/Pegasus/default.nix @@ -5,6 +5,8 @@ in { system.stateVersion = "23.11"; imports = [ + ./hardware-configuration.nix + # Import system configuration ../../modules/system.nix ../../modules/containers.nix @@ -20,33 +22,8 @@ in { networking.useDHCP = lib.mkDefault true; # Bootloader configuration - boot = { - kernelModules = ["kvm-intel"]; - extraModulePackages = []; - - initrd = { - kernelModules = []; - availableKernelModules = [ - "xhci_pci" - "thunderbolt" - "vmd" - "nvme" - "usb_storage" - "sd_mod" - "rtsx_pci_sdmmc" - ]; - }; - - loader = { - grub = { - enable = true; - useOSProber = true; - }; - efi = { - canTouchEfiVariables = true; - }; - }; - }; + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; # Setup Audio sound.enable = true; diff --git a/hosts/Pegasus/hardware-configuration.nix b/hosts/Pegasus/hardware-configuration.nix new file mode 100644 index 0000000..71785e7 --- /dev/null +++ b/hosts/Pegasus/hardware-configuration.nix @@ -0,0 +1,41 @@ +# 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, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-amd"]; + boot.extraModulePackages = []; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/252491b6-ec4c-49f5-93ae-ed25ad640078"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/A50A-2C06"; + 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.enp42s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}