mirror of
https://github.com/NixOS/nixos-hardware
synced 2024-11-10 04:59:40 +01:00
231274268f
Option is now in nixpkgs under `hardware.amdgpu.initrd.enable` as of NixOS/nixpkgs@6a0b6a6b74
51 lines
974 B
Nix
51 lines
974 B
Nix
{ 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 4060 Mobile
|
|
|
|
boot = {
|
|
blacklistedKernelModules = [ "nouveau" ];
|
|
};
|
|
|
|
# Also in nvidia/default.nix
|
|
services.xserver.videoDrivers = mkDefault [ "nvidia" ];
|
|
|
|
hardware = {
|
|
## Enable the Nvidia card, as well as Prime and Offload:
|
|
amdgpu.initrd.enable = lib.mkDefault true;
|
|
|
|
nvidia = {
|
|
modesetting.enable = true;
|
|
nvidiaSettings = true;
|
|
|
|
prime = {
|
|
offload = {
|
|
enable = true;
|
|
enableOffloadCmd = true;
|
|
};
|
|
amdgpuBusId = "PCI:101:0:0";
|
|
nvidiaBusId = "PCI:1:0:0";
|
|
};
|
|
|
|
powerManagement = {
|
|
# This is unreliable on the 4060; works a few times, then hangs:
|
|
# enable = true;
|
|
# finegrained = true
|
|
};
|
|
};
|
|
};
|
|
}
|