diff options
Diffstat (limited to 'hosts/shinji/hardware.nix')
| -rw-r--r-- | hosts/shinji/hardware.nix | 44 |
1 files changed, 38 insertions, 6 deletions
diff --git a/hosts/shinji/hardware.nix b/hosts/shinji/hardware.nix index a2953be..e7877b9 100644 --- a/hosts/shinji/hardware.nix +++ b/hosts/shinji/hardware.nix @@ -1,4 +1,13 @@ -{config, ...}: { +{ + config, + inputs, + ... +}: { + # external defaults + imports = [ + inputs.nixos-hardware.nixosModules.lenovo-yoga-7-slim-gen8 + ]; + # bootloader boot.loader = { efi.canTouchEfiVariables = true; @@ -21,13 +30,10 @@ boot.initrd.kernelModules = [ "vfio_pci" "vfio" - "vfio_iommu_type1" ]; boot.kernelModules = ["kvm-amd"]; boot.blacklistedKernelModules = ["nouveau"]; - boot.kernelParams = [ - "amd_iommu=on" - ]; + boot.kernelParams = []; boot.extraModulePackages = []; boot.supportedFilesystems = ["ntfs"]; @@ -38,8 +44,34 @@ hardware.enableRedistributableFirmware = true; hardware.cpu.amd.updateMicrocode = true; + # nvidia + services.xserver.videoDrivers = ["modesetting" "nvidia"]; + hardware.nvidia = { + modesetting.enable = true; + powerManagement = { + enable = false; + finegrained = false; + }; + prime = { + offload = { + enable = true; + enableOffloadCmd = true; + }; + amdgpuBusId = "PCI:115:0:0"; + nvidiaBusId = "PCI:1:0:0"; + }; + open = true; + nvidiaSettings = true; + package = config.boot.kernelPackages.nvidiaPackages.stable; + }; + unfreePackages = [ + "nvidia-x11" + "nvidia-settings" + ]; + # luks device boot.initrd.luks.devices."root".device = "/dev/disk/by-uuid/ad489bfa-4280-44ea-8ad2-60347b516d60"; + boot.initrd.luks.devices."swap".device = "/dev/disk/by-uuid/550e638d-eade-4d2f-aa39-c38774c91af3"; # root fileSystems."/" = { @@ -56,6 +88,6 @@ # swap swapDevices = [ - {device = "/dev/disk/by-uuid/57caa02d-8569-43e3-8bf9-09dd6f02b191";} + {device = "/dev/disk/by-uuid/8a7ce615-f5c0-4b0c-a9a5-bddf2d6c2ab0";} ]; } |