mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-09-10 03:42:06 +02:00
- render Niri on the Intel iGPU while retaining NVIDIA-connected physical outputs - encode Sunshine streams with Intel VAAPI and wait for a Niri output before startup - load VKMS persistently for headless sessions and configure `Virtual-1` at 2560x1600@60 - let Moonlight request the stream bitrate instead of enforcing a 20 Mbps host cap - remove unsupported Dynamic Boost and global NVIDIA session overrides - grant Sunshine access to virtual input devices - add a Nushell recovery helper that starts a temporary greetd/Niri session from SSH - identify and safely replace normal, standalone, or previous transient Niri sessions - launch the transient service in the background and verify greetd, Niri, and Sunshine before returning - ignore local `.worktrees` directories and keep eval regression coverage focused on structural behavior
58 lines
1.5 KiB
Nix
58 lines
1.5 KiB
Nix
{
|
|
pkgs,
|
|
modulesPath,
|
|
...
|
|
}:
|
|
{
|
|
|
|
imports = [
|
|
(modulesPath + "/hardware/cpu/intel-npu.nix")
|
|
];
|
|
|
|
# Intel NPU support
|
|
hardware.cpu.intel.npu.enable = true;
|
|
|
|
# kvm virtualization support
|
|
boot.initrd.kernelModules = [ ];
|
|
boot.kernelModules = [
|
|
"kvm-intel"
|
|
# Provide a connected DRM output when the NVIDIA-attached monitors are off.
|
|
# Niri exposes it as Virtual-1 for headless Sunshine sessions.
|
|
"vkms"
|
|
];
|
|
boot.extraModprobeConfig = ''
|
|
options kvm_intel nested=1
|
|
# Create Virtual-1 as soon as vkms loads, including during normal physical sessions.
|
|
options vkms create_default_dev=1
|
|
'';
|
|
boot.extraModulePackages = [ ];
|
|
|
|
# Intel Graphics
|
|
# https://wiki.nixos.org/wiki/Intel_Graphics
|
|
|
|
services.xserver.videoDrivers = [ "modesetting" ];
|
|
|
|
hardware.graphics = {
|
|
enable = true;
|
|
extraPackages = with pkgs; [
|
|
# Required for modern Intel GPUs (Xe iGPU and ARC)
|
|
intel-media-driver # VA-API (iHD) userspace
|
|
vpl-gpu-rt # oneVPL (QSV) runtime
|
|
|
|
# Optional (compute / tooling):
|
|
intel-compute-runtime # OpenCL (NEO) + Level Zero for Arc/Xe
|
|
];
|
|
};
|
|
|
|
environment.sessionVariables = {
|
|
LIBVA_DRIVER_NAME = "iHD"; # Prefer the modern iHD backend
|
|
};
|
|
|
|
# May help if FFmpeg/VAAPI/QSV init fails (esp. on Arc with i915):
|
|
hardware.enableRedistributableFirmware = true;
|
|
boot.kernelParams = [ "i915.enable_guc=3" ];
|
|
|
|
# May help services that have trouble accessing /dev/dri (e.g., jellyfin/plex):
|
|
# users.users.<service>.extraGroups = [ "video" "render" ];
|
|
}
|