mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-05-18 13:47:10 +02:00
306741c2a7
* feat: idols-ai - use intel intel iGPU by default, choose Nvidia dGPU manullay - via prime
* fix: niri - update output names for new motherboard
* fix: niri - DP-1 with prime offload mode - supports only 120HZ
* flake.lock: Update
Flake lock file updates:
• Updated input 'nixpkgs-master':
'github:nixos/nixpkgs/3879e47ce293fb2932d656aa56551a8e80718533?narHash=sha256-siN4x7y/S0FOdjPC1W0Z/vrX4Rlu%2BVClkEGngmSd0vM%3D' (2026-03-24)
→ 'github:nixos/nixpkgs/03de9fe87cb2dcec8da9dbaa3ad1c71ea7fef223?narHash=sha256-B7GmxbRADkklyXzV1ahgY4QhCpbQ3crzPCCs2hf6bPM%3D' (2026-04-26)
* flake.lock: Update
Flake lock file updates:
• Updated input 'nixpkgs-stable':
'github:nixos/nixpkgs/e9f278faa1d0c2fc835bd331d4666b59b505a410?narHash=sha256-Jms57zzlFf64ayKzzBWSE2SGvJmK%2BNGt8Gli71d9kmY%3D' (2026-03-14)
→ 'github:nixos/nixpkgs/a4bf06618f0b5ee50f14ed8f0da77d34ecc19160?narHash=sha256-AIiMJiqvGrN4HyLEbKAoCSRRYn0rnlW5VbKNIMIYqm4%3D' (2026-04-25)
63 lines
2.0 KiB
Nix
63 lines
2.0 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
{
|
|
# ===============================================================================================
|
|
# for Nvidia GPU
|
|
# https://wiki.nixos.org/wiki/NVIDIA
|
|
# https://wiki.hyprland.org/Nvidia/
|
|
# ===============================================================================================
|
|
|
|
# Hybrid graphics with PRIME[integrated GPU (iGPU) + dedicated GPU (dGPU)]
|
|
hardware.nvidia.prime = {
|
|
# puts dGPU(Nvidia) to sleep and lets the iGPU handle all tasks by default.
|
|
offload.enable = true;
|
|
|
|
intelBusId = "PCI:0@0:2:0";
|
|
nvidiaBusId = "PCI:2@0:0:0";
|
|
};
|
|
|
|
boot.kernelParams = [
|
|
# Since NVIDIA does not load kernel mode setting by default,
|
|
# enabling it is required to make Wayland compositors function properly.
|
|
"nvidia-drm.fbdev=1"
|
|
];
|
|
services.xserver.videoDrivers = [ "nvidia" ]; # will install nvidia-vaapi-driver by default
|
|
|
|
hardware.nvidia = {
|
|
# Open-source kernel modules are preferred over and planned to steadily replace proprietary modules
|
|
open = true;
|
|
nvidiaSettings = true;
|
|
|
|
# Optionally, you may need to select the appropriate driver version for your specific GPU.
|
|
# https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/os-specific/linux/nvidia-x11/default.nix
|
|
# package = config.boot.kernelPackages.nvidiaPackages.production;
|
|
|
|
# https://github.com/NixOS/nixpkgs/issues/489947
|
|
package = config.boot.kernelPackages.nvidiaPackages.latest;
|
|
|
|
# required by most wayland compositors!
|
|
modesetting.enable = true;
|
|
powerManagement.enable = true;
|
|
|
|
dynamicBoost.enable = lib.mkForce true;
|
|
};
|
|
|
|
hardware.nvidia-container-toolkit.enable = true;
|
|
hardware.graphics = {
|
|
enable = true;
|
|
# needed by nvidia-docker
|
|
enable32Bit = true;
|
|
};
|
|
|
|
services.sunshine.settings = {
|
|
max_bitrate = 20000; # in Kbps
|
|
# NVIDIA NVENC Encoder
|
|
nvenc_preset = 3; # 1(fastest + worst quality) - 7(slowest + best quality)
|
|
nvenc_twopass = "full_res"; # quarter_res / full_res.
|
|
};
|
|
}
|