dot

vizie's NixOS desktop: Hyprland, CachyOS kernel and gaming tweaks

43 lines1078 bytesNix
1# RTX 3080 Ti with the open kernel module, as linux-cachyos-nvidia-open on
2# CachyOS. Turned off in the test VM (see vm.nix).
3{
4 config,
5 lib,
6 pkgs,
7 ...
8}:
9let
10 cfg = config.dot.nvidia;
11in
12{
13 options.dot.nvidia.enable = lib.mkEnableOption "the NVIDIA driver" // {
14 default = true;
15 };
16
17 config = lib.mkMerge [
18 {
19 hardware.graphics = {
20 enable = true;
21 enable32Bit = true;
22 };
23 }
24
25 (lib.mkIf cfg.enable {
26 services.xserver.videoDrivers = [ "nvidia" ];
27
28 hardware.nvidia = {
29 open = true;
30 # 615.x, the same branch CachyOS has.
31 package = config.boot.kernelPackages.nvidiaPackages.latest;
32 modesetting.enable = true;
33 nvidiaSettings = true;
34 # Not set up on CachyOS either (no nvidia-suspend services enabled).
35 powerManagement.enable = false;
36 };
37
38 # libva-nvidia-driver: Firefox hardware video decoding (see the NVD_BACKEND
39 # and LIBVA_DRIVER_NAME lines in hyprland.lua).
40 hardware.graphics.extraPackages = [ pkgs.nvidia-vaapi-driver ];
41 })
42 ];
43}