This commit is contained in:
adrtivv 2025-11-07 13:37:27 +09:00 committed by GitHub
commit d5f0ec9c40
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 66 additions and 0 deletions

View file

@ -0,0 +1,14 @@
{
lib,
config,
...
}:
let
nvidiaPackage = config.hardware.nvidia.package;
in
{
imports = [ ../. ];
# enable the open source drivers if the package supports it
hardware.nvidia.open = lib.mkOverride 990 (nvidiaPackage ? open && nvidiaPackage ? firmware);
}

View file

@ -0,0 +1,19 @@
# system information
```
$ nix-info -m
- system: `"x86_64-linux"`
- host os: `Linux 6.12.49, NixOS, 25.11 (Xantusia), 25.11.20250928.e9f00bd`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.28.5`
```
# lspci output
```
$ lspci
01:00.0 VGA compatible controller: NVIDIA Corporation GB206M [GeForce RTX 5060 Max-Q / Mobile] (rev a1)
06:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] HawkPoint1 (rev b5)
```

View file

@ -0,0 +1,33 @@
{
lib,
pkgs,
...
}:
{
imports = [
../../../../common/cpu/amd
../../../../common/gpu/amd
../../../../common/gpu/nvidia
../../../../common/gpu/nvidia/blackwell
../../../../common/gpu/nvidia/prime.nix
../../../../common/pc/laptop
../../../../common/pc/ssd
];
hardware.nvidia = {
modesetting.enable = lib.mkDefault true;
open = lib.mkDefault true;
powerManagement = {
enable = lib.mkDefault true;
finegrained = lib.mkDefault true;
};
prime = {
amdgpuBusId = "PCI:6:0:0"; # 06:00.0 in hexadecimal -> 6:0:0 in decimal
nvidiaBusId = "PCI:1:0:0"; # 01:00.0 in hexadecimal -> 1:0:0 in decimal
};
};
# AMD has better battery life with PPD over TLP:
# https://community.frame.work/t/responded-amd-7040-sleep-states/38101/13
services.power-profiles-daemon.enable = lib.mkDefault true;
}