summaryrefslogtreecommitdiff
path: root/os/cez/modules/specialisation/nvidia.nix
blob: 3ac30b4346ca1cdb4badc2f47a36a4d51cd4140d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{ lib, ... }:
{
  boot = {
    kernelParams = [ "transparent_hugepage=always" ];
    kernel.sysctl."vm.max_map_count" = 2147483642;
  };

  environment.variables = {
    DRI_PRIME = 1;
    __NV_PRIME_RENDER_OFFLOAD = 1;
    __VK_LAYER_NV_optimus = "NVIDIA_only";
    __GLX_VENDOR_LIBRARY_NAME = "nvidia";
  };

  hardware.nvidia = {
    open = true;
    nvidiaSettings = false;
    prime.sync.enable = true;
  };

  services = {
    xserver.videoDrivers = [ "nvidia" ];
    tlp.settings.PLATFORM_PROFILE_ON_AC = lib.mkForce "performance";
  };
}