./modules/core/nvidia.nix
{
pkgs,
config,
...
}: {
# Required for NVIDIA on both X11 and Wayland
services.xserver.enable = true;
services.xserver.videoDrivers = ["nvidia"];
hardware = {
graphics = {
enable = true;
# Required for Steam / Wine / DXVK
enable32Bit = true;
};
nvidia = {
modesetting.enable = true;
# Power management (can cause suspend issues)
powerManagement.enable = false;
powerManagement.finegrained = false;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
# Do not disable this unless your GPU is unsupported or if you have a good reason to.
open = true;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
# Stable driver is usually best for gaming
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
};
environment.systemPackages = with pkgs; [
vulkan-tools
vulkan-loader
];
}
Notes
enable32Bit = true is mandatory for:
vulkaninfo --summary
./modules/core/sound.nix
{ pkgs, ... }:
{
security.rtkit.enable = true;
services.pipewire = {
enable = true;
audio.enable = true;
pulse.enable = true;
wireplumber.enable = true;
alsa = {
enable = true;
support32Bit = true;
};
};
Notes
alsa.support32Bit = true is required for:
./modules/applications/gaming.nix
{pkgs, ...}: {
programs = {
gamescope = {
enable = true;
capSysNice = true;
};
steam = {
enable = true;
gamescopeSession.enable = true;
};
gamemode.enable = true;
};
hardware.xone.enable = true;
environment = {
systemPackages = with pkgs; [
dxvk
(lutris.override {
extraPkgs = pkgs: [
winetricks
wineWowPackages.staging
];
})
mangohud
protonup-ng
vkd3d
];
sessionVariables = {
STEAM_EXTRA_COMPAT_TOOLS_PATHS = "/home/ohlove/.steam/root/compatibilitytools.d";
};
};
}
final: prev: {
xow_dongle-firmware = prev.xow_dongle-firmware.overrideAttrs (old: {
installPhase = ''
runHook preInstall
# keep original name used by xow
install -Dm644 xow_dongle.bin \
$out/lib/firmware/xow_dongle.bin
# the extracted file from the 2nd cab
# (this is the one nixpkgs currently calls xow_dongle_045e_02e6.bin)
install -Dm644 xow_dongle_045e_02e6.bin \
$out/lib/firmware/xone_dongle_02fe.bin
# OPTIONAL: also satisfy setups that request 02e6
ln -s xone_dongle_02fe.bin \
$out/lib/firmware/xone_dongle_02e6.bin
runHook postInstall
'';
});
}
protonup -d "~/.steam/root/compatibilitytools.d/"
protonup
After installation, select Proton-GE per game in:
Steam → Game → Properties → Compatibility