summaryrefslogtreecommitdiff
path: root/modules/nixos/custom/nvk.nix
blob: 2178e6349ceeef34672fd042717fb3c149b34261 (plain)
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
29
30
31
32
33
34
{ config, lib, ... }:

let
  cfg = config.borealis.nvk;
in

{
  options.borealis.nvk = {
    enable = lib.mkEnableOption "an NVK specialisation";
  };

  config = lib.mkIf cfg.enable {
    specialisation = {
      nvk.configuration = {
        boot = {
          # required for GSP firmware
          kernelParams = [ "nouveau.config=NvGspRm=1" ];
          # we want early KMS
          # https://wiki.archlinux.org/title/Kernel_mode_setting#Early_KMS_start
          initrd.kernelModules = [ "nouveau" ];
        };

        hardware = {
          graphics.extraPackages = lib.mkForce [ ];
          nvidia-container-toolkit.enable = lib.mkForce false;
        };

        services.xserver.videoDrivers = lib.mkForce [ "modesetting" ];

        system.nixos.tags = [ "with-nvk" ];
      };
    };
  };
}