From a956ecb856a71aa8edb087a172ccff485fb8abbe Mon Sep 17 00:00:00 2001 From: Emi Simpson Date: Sun, 18 Dec 2022 12:38:51 -0500 Subject: [PATCH] Import the remaining hardware-config settings --- hardware-requirements.nix | 12 ++++++++++++ nixos.nix | 23 +++++++++++++---------- system-information.nix | 3 +++ 3 files changed, 28 insertions(+), 10 deletions(-) create mode 100644 hardware-requirements.nix diff --git a/hardware-requirements.nix b/hardware-requirements.nix new file mode 100644 index 0000000..08649e1 --- /dev/null +++ b/hardware-requirements.nix @@ -0,0 +1,12 @@ + +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ]; + boot.kernelModules = [ "kvm-intel" ]; +} \ No newline at end of file diff --git a/nixos.nix b/nixos.nix index 1c691d0..7cb24d1 100644 --- a/nixos.nix +++ b/nixos.nix @@ -1,20 +1,15 @@ # sudo nix-channel --add https://github.com/NixOS/nixos-hardware/archive/master.tar.gz nixos-hardware # sudo nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager -{ config, pkgs, ... }: - +let systemInformation = import ./system-information.nix; in +{ config, pkgs, lib, ... }: { networking.hostName = "kudzu"; imports = - [ # Include the results of the hardware scan. - # - # DON'T FORGET to add your hardware config too - # https://github.com/NixOS/nixos-hardware/ - # - # Also make sure to move the swap configuration to the hardware config - /etc/nixos/hardware-configuration.nix + [ ./filesystems.nix + ./hardware-requirements.nix ]; @@ -42,6 +37,8 @@ # Enable networking networking.networkmanager.enable = true; + powerManagement.cpuFreqGovernor = "powersave"; + # Set your time zone. time.timeZone = "America/New_York"; @@ -159,6 +156,7 @@ # Allow unfree packages nixpkgs.config.allowUnfree = true; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; # List packages installed in system profile. To search, run: environment.systemPackages = with pkgs; [ @@ -221,4 +219,9 @@ libvdpau-va-gl ]; }; -} + hardware.enableAllFirmware = true; + hardware.cpu.intel.updateMicrocode = systemInformation.isIntel; + + # high-resolution display + hardware.video.hidpi.enable = systemInformation.isHiDPI; +} \ No newline at end of file diff --git a/system-information.nix b/system-information.nix index 5471a98..21b7a1a 100644 --- a/system-information.nix +++ b/system-information.nix @@ -2,4 +2,7 @@ rootPartition = "/dev/disk/by-uuid/850e0a62-fd82-4360-b4d7-258817e86380"; swapPartition = "/dev/disk/by-uuid/6144d426-6c5f-4a8a-ac16-d4d5eecbf7a0"; efiPartition = "/dev/disk/by-uuid/E5A8-38EA"; + + isHiDPI = true; + isIntel = true; }