all repos — nixfiles @ 6db9eaad8e78f882ae44a28edcc4d11d2ffd5e28

System and user configuration, managed by nix and home-manager

system/settings/hardware/nvidia-gpu.nix (view raw)

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
26
27
28
{ config
, pkgs
, lib
, ...
}:
let
  nvidia_x11 = config.boot.kernelPackages.nvidia_x11;
in
{
  services.xserver.videoDrivers = [ "nvidia" ];
  boot = {
    blacklistedKernelModules = [ "nouveau" ];
    extraModulePackages = [ nvidia_x11 ];
  };

  environment.systemPackages = [ nvidia_x11 pkgs.nvidia-vaapi-driver ];
  hardware.nvidia = {
    modesetting.enable = true;
    powerManagement = {
      enable = true;
    };
  };

  nixpkgs.config.allowUnfree = true;
  services.picom = {
    enable = lib.mkDefault true;
  };
}