diff options
| -rw-r--r-- | machines/x/configuration.nix | 1 | ||||
| -rw-r--r-- | modules/amd.nix | 8 | ||||
| -rw-r--r-- | modules/amdgpu.nix | 7 | ||||
| -rw-r--r-- | modules/nvidia.nix | 12 | 
4 files changed, 17 insertions, 11 deletions
| diff --git a/machines/x/configuration.nix b/machines/x/configuration.nix index d7bece0..8f31309 100644 --- a/machines/x/configuration.nix +++ b/machines/x/configuration.nix @@ -7,6 +7,7 @@    ] ++ (map (path: ../../modules/${path}) [      "core/global.nix"      "amdgpu.nix" +    "amd.nix"      "nvidia.nix"      "core/audio.nix"      "core/bluetooth.nix" diff --git a/modules/amd.nix b/modules/amd.nix new file mode 100644 index 0000000..6ec3e2b --- /dev/null +++ b/modules/amd.nix @@ -0,0 +1,8 @@ +{ lib, config, ... }: +let +  kver = config.boot.kernelPackages.kernel.version; +in +{ +  boot.kernelParams = [ "amd_pstate=active" ]; +  hardware.cpu.amd.updateMicrocode = config.hardware.enableRedistributableFirmware; +} diff --git a/modules/amdgpu.nix b/modules/amdgpu.nix index 4d4bb4c..5dcd9b0 100644 --- a/modules/amdgpu.nix +++ b/modules/amdgpu.nix @@ -19,9 +19,12 @@    services.xserver.videoDrivers = [ "amdgpu" ];    boot.initrd.kernelModules = [ "amdgpu" ]; +  opengl.extraPackages = with pkgs; [ +    vaapiVdpau +    libvdpau-va-gl +  ]; +    systemd.tmpfiles.rules = [      "L+    /opt/rocm/hip   -    -    -     -    ${pkgs.rocmPackages.clr}"    ]; - -  # environment.systemPackages = [ pkgs.cudatoolkit ];  } diff --git a/modules/nvidia.nix b/modules/nvidia.nix index d79f2bb..16966e0 100644 --- a/modules/nvidia.nix +++ b/modules/nvidia.nix @@ -1,20 +1,14 @@  { pkgs, config, ... }:  { -  hardware.opengl = { -    enable = true; -    driSupport = true; -    driSupport32Bit = true; -  }; -    services.xserver.videoDrivers = [ "nvidia" ];    hardware.nvidia = {      modesetting.enable = true; -    powerManagement.enable = false; +    powerManagement.enable = true;      powerManagement.finegrained = false;      open = false; -    nvidiaSettings = false; +    nvidiaSettings = true;      package = config.boot.kernelPackages.nvidiaPackages.stable;      prime = { @@ -22,7 +16,7 @@          enable = true;          enableOffloadCmd = true;        }; -      amdgpuBusId = "PCI:0:2:0"; +      amdgpuBusId = "PCI:5:0:0";        nvidiaBusId = "PCI:1:0:0";      };    }; | 
