feat: abstract out gpu elements
This commit is contained in:
parent
7bc0a2c88b
commit
340c5d6f25
5 changed files with 24 additions and 6 deletions
|
@ -1,8 +1,7 @@
|
||||||
{ ... }: {
|
{ ... }: {
|
||||||
|
imports = [ ./common.nix ];
|
||||||
|
|
||||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||||
|
|
||||||
services.xserver.videoDrivers = [ "amdgpu" ];
|
services.xserver.videoDrivers = [ "amdgpu" ];
|
||||||
|
|
||||||
hardware.opengl.driSupport = true;
|
|
||||||
hardware.opengl.driSupport32Bit = true;
|
|
||||||
}
|
}
|
12
profiles/hardware/gpu/common.nix
Normal file
12
profiles/hardware/gpu/common.nix
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{ pkgs, ... }: {
|
||||||
|
hardware.opengl = {
|
||||||
|
enable = true;
|
||||||
|
driSupport = true;
|
||||||
|
driSupport32Bit = true;
|
||||||
|
|
||||||
|
extraPackages = with pkgs; [
|
||||||
|
vaapiVdpau
|
||||||
|
libvdpau-va-gl
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
8
profiles/hardware/gpu/intel.nix
Normal file
8
profiles/hardware/gpu/intel.nix
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{ pkgs, ... }: {
|
||||||
|
imports = [ ./common.nix ];
|
||||||
|
|
||||||
|
hardware.opengl.extraPackages = with pkgs; [
|
||||||
|
intel-media-driver
|
||||||
|
vaapiIntel
|
||||||
|
];
|
||||||
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
{ ... }: {
|
{ ... }: {
|
||||||
|
imports = [ ./common.nix ];
|
||||||
|
|
||||||
services.xserver.videoDrivers = [ "nvidia" ];
|
services.xserver.videoDrivers = [ "nvidia" ];
|
||||||
|
|
||||||
hardware.nvidia.modesetting.enable = true;
|
hardware.nvidia.modesetting.enable = true;
|
||||||
hardware.opengl.driSupport = true;
|
|
||||||
hardware.opengl.driSupport32Bit = true;
|
|
||||||
}
|
}
|
|
@ -1 +0,0 @@
|
||||||
{ ... }: { }
|
|
Loading…
Add table
Add a link
Reference in a new issue