forked from NixOS/nixos-hardware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
43 lines (35 loc) · 913 Bytes
/
default.nix
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
35
36
37
38
39
40
41
42
43
# Including this file will enable the NVidia driver, and PRIME offload
{ lib, pkgs, ... }:
let
inherit (lib) mkDefault;
in {
imports = [
../shared.nix
## "prime.nix" loads this, aleady:
# ../../../../common/gpu/nvidia
../../../../../common/gpu/nvidia/prime.nix
];
# NVIDIA GeForce RTX 3050 Mobile (Ampere)
services.xserver.videoDrivers = mkDefault [ "nvidia" ];
hardware = {
## Enable the Nvidia card, as well as Prime and Offload:
amdgpu.initrd.enable = true;
nvidia = {
modesetting.enable = true;
nvidiaSettings = true;
prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};
amdgpuBusId = "PCI:4:0:0";
nvidiaBusId = "PCI:1:0:0";
};
powerManagement = {
enable = true;
# Doesn't seem to be reliable, yet?
# finegrained = true
};
};
};
}