From a02eaafaac6e8afd7472732bd2364656e3360929 Mon Sep 17 00:00:00 2001 From: Nettika Date: Mon, 10 Jun 2024 21:01:40 -0700 Subject: [PATCH] Manually write hardware configurations --- configuration.nix | 20 +---------------- hardware-configuration.nix | 39 --------------------------------- hardware.nix | 45 ++++++++++++++++++++++++++++++++++++++ networking.nix | 2 +- users.nix | 2 +- 5 files changed, 48 insertions(+), 60 deletions(-) delete mode 100644 hardware-configuration.nix create mode 100644 hardware.nix diff --git a/configuration.nix b/configuration.nix index 8716319..ead0ef3 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,16 +1,12 @@ { config, lib, pkgs, ... }: - { imports = [ - ./hardware-configuration.nix + ./hardware.nix ./networking.nix ./users.nix ]; - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - time.timeZone = "America/Los_Angeles"; i18n.defaultLocale = "en_US.UTF-8"; @@ -25,20 +21,6 @@ vscode ]; - hardware.opengl = { - enable = true; - driSupport32Bit = true; - }; - - #hardware.nvidia = { - # modesetting.enable = true; - # prime = { - # sync.enable = true; - # nvidiaBusId = "PCI:01:00:0"; - # amdgpuBusId = "PCI:05:00:0"; - # }; - #}; - services.xserver = { enable = true; #videoDrivers = ["nvidia" "amdgpu"]; diff --git a/hardware-configuration.nix b/hardware-configuration.nix deleted file mode 100644 index d0d0233..0000000 --- a/hardware-configuration.nix +++ /dev/null @@ -1,39 +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/648c6539-892c-40d7-8b07-23fe760df02a"; - fsType = "ext4"; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/1D62-C30E"; - fsType = "vfat"; - options = [ "fmask=0022" "dmask=0022" ]; - }; - - 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.enp2s0.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/hardware.nix b/hardware.nix new file mode 100644 index 0000000..d1fa33f --- /dev/null +++ b/hardware.nix @@ -0,0 +1,45 @@ +{ ... }: +{ + boot = { + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "usbhid" + "usb_storage" + "sd_mod" + ]; + kernelModules = ["kvm-amd"]; + # kernelParams = ["amd_pstate=active"]; + }; + + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/648c6539-892c-40d7-8b07-23fe760df02a"; + fsType = "ext4"; + }; + "/boot" = { + device = "/dev/disk/by-uuid/1D62-C30E"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + }; + + nixpkgs.hostPlatform = "x86_64-linux"; + + hardware = { + enableRedistributableFirmware = true; + cpu.amd.updateMicrocode = true; + opengl = { + enable = true; + driSupport32Bit = true; + }; + # nvidia.prime = { + # amdgpuBusId = "PCI:05:00:0"; + # nvidiaBusId = "PCI:01:00:0"; + # }; + }; +} diff --git a/networking.nix b/networking.nix index 1a153d9..3251d6d 100644 --- a/networking.nix +++ b/networking.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, modulesPath, ... }: +{ ... }: { networking = { hostName = "marauder"; diff --git a/users.nix b/users.nix index 4c951f1..39d0e50 100644 --- a/users.nix +++ b/users.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, modulesPath, ... }: +{ ... }: { users.users = { nettika = {