From 065a8ad613ada51b0a44abe40a67efe817d9bb48 Mon Sep 17 00:00:00 2001 From: asonix Date: Sat, 4 May 2024 16:41:54 -0500 Subject: [PATCH] Add nvidia driver for firestar, use nixos-hardware amd gpu config --- firestar/default.nix | 2 + firestar/hardware-configuration.nix | 71 +++++++++++++++-------------- flake.nix | 10 ++++ 3 files changed, 48 insertions(+), 35 deletions(-) diff --git a/firestar/default.nix b/firestar/default.nix index 880b494..fc51748 100644 --- a/firestar/default.nix +++ b/firestar/default.nix @@ -30,6 +30,8 @@ "/keyfile" = null; }; + boot.extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ]; + # Enable swap on luks boot.initrd.luks.devices."luks-28ea4268-e74a-4ed7-9484-b113c676124e".device = "/dev/disk/by-uuid/28ea4268-e74a-4ed7-9484-b113c676124e"; boot.initrd.luks.devices."luks-28ea4268-e74a-4ed7-9484-b113c676124e".keyFile = "/crypto_keyfile.bin"; diff --git a/firestar/hardware-configuration.nix b/firestar/hardware-configuration.nix index ad5718c..3827629 100644 --- a/firestar/hardware-configuration.nix +++ b/firestar/hardware-configuration.nix @@ -9,7 +9,7 @@ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "vmd" "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ]; + boot.initrd.availableKernelModules = [ "vmd" "xhci_pci" "ahci" "nvme" "usbhid" "sd_mod" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; @@ -24,19 +24,7 @@ fileSystems."/boot/efi" = { device = "/dev/disk/by-uuid/53F9-82A1"; fsType = "vfat"; - }; - - fileSystems."/btrfs/nvme2" = - { device = "/dev/disk/by-uuid/fe880346-4ec8-4c64-8992-60127a484147"; - fsType = "btrfs"; - }; - - boot.initrd.luks.devices."cryptdrive2".device = "/dev/disk/by-uuid/fd0c26d4-db05-4218-826c-51a87dd39eb5"; - - fileSystems."/home/asonix/Games2" = - { device = "/dev/disk/by-uuid/fe880346-4ec8-4c64-8992-60127a484147"; - fsType = "btrfs"; - options = [ "subvol=@games" ]; + options = [ "fmask=0022" "dmask=0022" ]; }; fileSystems."/btrfs/nvme" = @@ -65,6 +53,19 @@ options = [ "subvol=@games" ]; }; + fileSystems."/btrfs/nvme2" = + { device = "/dev/disk/by-uuid/fe880346-4ec8-4c64-8992-60127a484147"; + fsType = "btrfs"; + }; + + boot.initrd.luks.devices."cryptdrive2".device = "/dev/disk/by-uuid/fd0c26d4-db05-4218-826c-51a87dd39eb5"; + + fileSystems."/home/asonix/Games2" = + { device = "/dev/disk/by-uuid/fe880346-4ec8-4c64-8992-60127a484147"; + fsType = "btrfs"; + options = [ "subvol=@games" ]; + }; + fileSystems."/btrfs/hdd" = { device = "/dev/disk/by-uuid/bce8bc87-faf2-4b9e-90d2-cb8281c40c7e"; fsType = "btrfs"; @@ -72,24 +73,6 @@ boot.initrd.luks.devices."cryptdrive4".device = "/dev/disk/by-uuid/d2119824-fe98-449b-9d1b-2ab552568493"; - fileSystems."/home/asonix/Documents" = - { device = "/dev/disk/by-uuid/bce8bc87-faf2-4b9e-90d2-cb8281c40c7e"; - fsType = "btrfs"; - options = [ "subvol=@documents" ]; - }; - - fileSystems."/home/asonix/Diskimages" = - { device = "/dev/disk/by-uuid/bce8bc87-faf2-4b9e-90d2-cb8281c40c7e"; - fsType = "btrfs"; - options = [ "subvol=@diskimages" ]; - }; - - fileSystems."/home/asonix/Downloads" = - { device = "/dev/disk/by-uuid/bce8bc87-faf2-4b9e-90d2-cb8281c40c7e"; - fsType = "btrfs"; - options = [ "subvol=@downloads" ]; - }; - fileSystems."/home/asonix/Videos" = { device = "/dev/disk/by-uuid/bce8bc87-faf2-4b9e-90d2-cb8281c40c7e"; fsType = "btrfs"; @@ -102,12 +85,30 @@ options = [ "subvol=@pictures" ]; }; + fileSystems."/home/asonix/Diskimages" = + { device = "/dev/disk/by-uuid/bce8bc87-faf2-4b9e-90d2-cb8281c40c7e"; + fsType = "btrfs"; + options = [ "subvol=@diskimages" ]; + }; + fileSystems."/home/asonix/Music" = { device = "/dev/disk/by-uuid/bce8bc87-faf2-4b9e-90d2-cb8281c40c7e"; fsType = "btrfs"; options = [ "subvol=@music" ]; }; + fileSystems."/home/asonix/Documents" = + { device = "/dev/disk/by-uuid/bce8bc87-faf2-4b9e-90d2-cb8281c40c7e"; + fsType = "btrfs"; + options = [ "subvol=@documents" ]; + }; + + fileSystems."/home/asonix/Downloads" = + { device = "/dev/disk/by-uuid/bce8bc87-faf2-4b9e-90d2-cb8281c40c7e"; + fsType = "btrfs"; + options = [ "subvol=@downloads" ]; + }; + swapDevices = [ { device = "/dev/disk/by-uuid/ec3f1ad9-5f72-4a8e-8562-f25156c936a2"; } ]; @@ -118,10 +119,10 @@ # with explicit per-interface declarations with `networking.interfaces..useDHCP`. networking.useDHCP = lib.mkDefault true; # networking.interfaces.docker0.useDHCP = lib.mkDefault true; - # networking.interfaces.enp114s0.useDHCP = lib.mkDefault true; + # networking.interfaces.enp9s0.useDHCP = lib.mkDefault true; # networking.interfaces.wg0.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp113s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp8s0.useDHCP = lib.mkDefault true; - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/flake.nix b/flake.nix index f9bbf96..b3e7a91 100644 --- a/flake.nix +++ b/flake.nix @@ -9,6 +9,16 @@ system = "x86_64-linux"; specialArgs = attrs; modules = [ + nixos-hardware.nixosModules.common-gpu-amd + ({ config, pkgs, ... }: { + hardware.nvidia = { + modesetting.enable = true; + open = false; + nvidiaSettings = false; + package = config.boot.kernelPackages.nvidiaPackages.stable; + }; + hardware.opengl.extraPackages = with pkgs; [ vaapiVdpau ]; + }) ./desktop.nix ./firestar ./fonts.nix