nixos-config/profiles/hardware.nix

36 lines
1.0 KiB
Nix
Raw Normal View History

2019-08-27 23:41:02 +04:00
{ pkgs, config, lib, ... }:
2021-02-07 02:38:11 +03:00
with config.deviceSpecific; {
2019-08-27 23:41:02 +04:00
2021-02-07 02:38:11 +03:00
hardware.cpu.${devInfo.cpu.vendor}.updateMicrocode = true;
hardware.enableRedistributableFirmware = true;
2019-08-27 23:41:02 +04:00
2019-09-14 22:12:56 +04:00
nixpkgs.config.packageOverrides = pkgs: {
vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
};
2021-02-07 02:38:11 +03:00
2019-09-14 22:12:56 +04:00
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
2021-02-07 02:38:11 +03:00
extraPackages = if devInfo.gpu.vendor == "intel" then [
2019-09-14 22:12:56 +04:00
pkgs.intel-media-driver
2021-09-07 11:56:15 +03:00
] else if devInfo.gpu.vendor == "amd" then [
pkgs.rocm-opencl-icd
pkgs.rocm-opencl-runtime
2021-06-29 22:29:22 +03:00
pkgs.amdvlk
2019-09-14 22:12:56 +04:00
] else [ ];
2021-06-29 22:29:22 +03:00
extraPackages32 = lib.mkIf (devInfo.gpu.vendor == "amd") [
pkgs.driversi686Linux.amdvlk
];
2019-09-14 22:12:56 +04:00
};
2021-09-07 11:56:15 +03:00
environment.sessionVariables = lib.mkIf (devInfo.gpu.vendor == "intel") {
2019-09-17 02:26:38 +04:00
GST_VAAPI_ALL_DRIVERS = "1";
LIBVA_DRIVER_NAME = "iHD";
};
2021-09-07 11:56:15 +03:00
boot.initrd.kernelModules = if devInfo.gpu.vendor == "amd" then [
"amdgpu"
] else if devInfo.gpu.vendor == "intel" then [
2021-10-30 21:04:53 +03:00
"i915"
2021-09-07 11:56:15 +03:00
] else [ ];
2019-08-27 23:41:02 +04:00
}