2023-06-25 23:11:52 +02:00
|
|
|
{ lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (lib) mkDefault;
|
|
|
|
|
|
|
|
in {
|
|
|
|
imports = [
|
|
|
|
../shared.nix
|
|
|
|
## "prime.nix" loads this, aleady:
|
|
|
|
# ../../../common/gpu/nvidia
|
|
|
|
../../../../common/gpu/nvidia/prime.nix
|
2024-09-03 23:11:16 +02:00
|
|
|
../../../../common/gpu/nvidia/ada-lovelace
|
2024-06-26 09:34:50 +02:00
|
|
|
|
2023-06-25 23:11:52 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
# 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:
|
2024-09-25 06:35:02 +02:00
|
|
|
amdgpu.initrd.enable = mkDefault true;
|
2023-06-25 23:11:52 +02:00
|
|
|
|
|
|
|
nvidia = {
|
|
|
|
modesetting.enable = true;
|
2024-09-25 06:35:02 +02:00
|
|
|
nvidiaSettings = mkDefault true;
|
2023-06-25 23:11:52 +02:00
|
|
|
|
|
|
|
prime = {
|
|
|
|
offload = {
|
2024-09-25 06:35:02 +02:00
|
|
|
enable = mkDefault true;
|
|
|
|
enableOffloadCmd = mkDefault true;
|
2023-06-25 23:11:52 +02:00
|
|
|
};
|
|
|
|
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
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|