feature: gaming setup & config init
This commit is contained in:
parent
1ae2855bb1
commit
c6594bcbff
6 changed files with 296 additions and 147 deletions
76
modules/nixos/desktop/gaming.nix
Normal file
76
modules/nixos/desktop/gaming.nix
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
{ pkgs, ... }: {
|
||||
# Gaming configuration module
|
||||
# Steam, Proton, Vulkan, Wine, and gaming optimizations
|
||||
|
||||
# Steam with Proton support
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
remotePlay.openFirewall = true;
|
||||
dedicatedServer.openFirewall = true;
|
||||
|
||||
# Enable Proton compatibility layer
|
||||
extraCompatPackages = with pkgs;
|
||||
[
|
||||
proton-ge-bin # GloriousEggroll's Proton builds
|
||||
];
|
||||
};
|
||||
|
||||
# GameMode for performance optimization
|
||||
programs.gamemode = {
|
||||
enable = true;
|
||||
settings = {
|
||||
general = { renice = 10; };
|
||||
custom = {
|
||||
start = "${pkgs.libnotify}/bin/notify-send 'GameMode started'";
|
||||
end = "${pkgs.libnotify}/bin/notify-send 'GameMode ended'";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Enable 32-bit graphics support for games
|
||||
hardware.graphics = {
|
||||
enable = true;
|
||||
enable32Bit = true;
|
||||
};
|
||||
|
||||
# Gaming-related packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Game launchers
|
||||
lutris
|
||||
heroic # Epic Games, GOG launcher
|
||||
# bottles # Windows app manager
|
||||
|
||||
# Wine for Windows games
|
||||
wineWowPackages.stable # Both 32 and 64-bit Wine
|
||||
winetricks
|
||||
|
||||
# Performance monitoring
|
||||
mangohud # FPS overlay and performance metrics
|
||||
# gamescope # Gaming compositor/micro-compositor
|
||||
|
||||
# Proton utilities
|
||||
# protonup-qt # Manage Proton versions
|
||||
protontricks # Winetricks for Proton games
|
||||
|
||||
# Communication
|
||||
discord
|
||||
# teamspeak_client
|
||||
|
||||
# Other gaming tools
|
||||
# steam-run # Run non-Steam games in Steam runtime
|
||||
];
|
||||
|
||||
# Vulkan support
|
||||
environment.variables = {
|
||||
# Enable Vulkan validation layers for debugging (optional)
|
||||
# VK_LAYER_PATH = "${pkgs.vulkan-validation-layers}/share/vulkan/explicit_layer.d";
|
||||
};
|
||||
|
||||
# Kernel parameters for gaming performance (optional, adjust as needed)
|
||||
# boot.kernelParams = [
|
||||
# "mitigations=off" # Disable CPU mitigations for performance (less secure)
|
||||
# ];
|
||||
|
||||
# Increase file watchers for game modding tools
|
||||
boot.kernel.sysctl = { "fs.inotify.max_user_watches" = 524288; };
|
||||
}
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
{ pkgs, ... }: {
|
||||
# Example desktop development workstation configuration
|
||||
# Copy and modify for your actual hardware
|
||||
|
||||
# Boot configuration (adjust for your system)
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
# Hostname
|
||||
networking.hostName = "desktop-dev";
|
||||
|
||||
# Import desktop environment (choose one)
|
||||
imports = [
|
||||
../desktops/hyprland.nix
|
||||
# ../desktops/plasma.nix
|
||||
# ../desktops/niri.nix
|
||||
];
|
||||
|
||||
# Hardware-specific settings (adjust for your hardware)
|
||||
# boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "sd_mod" ];
|
||||
|
||||
# GPU drivers (uncomment if using NVIDIA)
|
||||
# services.xserver.videoDrivers = [ "nvidia" ];
|
||||
# hardware.nvidia = {
|
||||
# modesetting.enable = true;
|
||||
# open = false; # Use proprietary driver
|
||||
# };
|
||||
|
||||
# Optional: Enable bluetooth
|
||||
# hardware.bluetooth.enable = true;
|
||||
|
||||
# Development-specific packages
|
||||
environment.systemPackages = with pkgs;
|
||||
[
|
||||
# Add desktop dev tools here
|
||||
# docker-compose
|
||||
# k9s
|
||||
];
|
||||
|
||||
# This value determines the NixOS release compatibility
|
||||
system.stateVersion = "24.05";
|
||||
}
|
||||
67
modules/nixos/hosts/desktop.nix
Normal file
67
modules/nixos/hosts/desktop.nix
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
{ lib, pkgs, ... }: {
|
||||
# Unified desktop configuration for gaming and development
|
||||
# Includes both KDE Plasma and Hyprland - switch at login screen
|
||||
|
||||
# Boot configuration with CachyOS LTS kernel
|
||||
boot = {
|
||||
loader.systemd-boot.enable = true;
|
||||
loader.efi.canTouchEfiVariables = true;
|
||||
kernelPackages = pkgs.linuxPackages_cachyos-lts;
|
||||
# Hardware-specific settings (adjust for your hardware)
|
||||
# initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "sd_mod" ];
|
||||
};
|
||||
|
||||
# Hostname
|
||||
networking.hostName = "desktop";
|
||||
|
||||
# Root filesystem configuration (REQUIRED - adjust for your hardware)
|
||||
# To generate proper config, run: nixos-generate-config --show-hardware-config
|
||||
fileSystems."/" = lib.mkDefault {
|
||||
device = "/dev/disk/by-label/nixos";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" = lib.mkDefault {
|
||||
device = "/dev/disk/by-label/boot";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
# Swap configuration (optional, adjust as needed)
|
||||
# swapDevices = [ { device = "/dev/disk/by-label/swap"; } ];
|
||||
|
||||
# Desktop environments - both available at login screen
|
||||
imports = [
|
||||
../desktops/plasma.nix # For gaming sessions
|
||||
../desktops/hyprland.nix # For development sessions
|
||||
# ../desktops/niri.nix # Available for future use
|
||||
../bluetooth.nix
|
||||
../desktop/gaming.nix # Gaming configuration (Steam, Proton, Vulkan, etc.)
|
||||
];
|
||||
|
||||
# GPU drivers (uncomment and adjust for your hardware)
|
||||
# For NVIDIA:
|
||||
# services.xserver.videoDrivers = [ "nvidia" ];
|
||||
# hardware.nvidia = {
|
||||
# modesetting.enable = true;
|
||||
# powerManagement.enable = false;
|
||||
# open = false; # Use proprietary driver
|
||||
# package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
# };
|
||||
#
|
||||
# For AMD:
|
||||
# services.xserver.videoDrivers = [ "amdgpu" ];
|
||||
#
|
||||
# For Intel:
|
||||
# services.xserver.videoDrivers = [ "modesetting" ];
|
||||
|
||||
# Additional system packages
|
||||
environment.systemPackages = with pkgs;
|
||||
[
|
||||
# Add system-wide tools here if needed
|
||||
# Gaming packages are configured in ../desktop/gaming.nix
|
||||
# Development tools are better sourced via `nix develop` shells
|
||||
];
|
||||
|
||||
# This value determines the NixOS release compatibility
|
||||
system.stateVersion = "24.05";
|
||||
}
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
{ pkgs, ... }: {
|
||||
# Example gaming desktop configuration
|
||||
# Copy and modify for your actual hardware
|
||||
|
||||
# Boot configuration
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
# Hostname
|
||||
networking.hostName = "gaming-rig";
|
||||
|
||||
# Import KDE Plasma for gaming
|
||||
imports = [ ../desktops/plasma.nix ];
|
||||
|
||||
# Gaming-specific settings
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
remotePlay.openFirewall = true;
|
||||
dedicatedServer.openFirewall = true;
|
||||
};
|
||||
|
||||
# GameMode for performance optimization
|
||||
programs.gamemode.enable = true;
|
||||
|
||||
# GPU drivers (example: NVIDIA)
|
||||
# services.xserver.videoDrivers = [ "nvidia" ];
|
||||
# hardware.nvidia = {
|
||||
# modesetting.enable = true;
|
||||
# powerManagement.enable = false;
|
||||
# open = false;
|
||||
# package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
# };
|
||||
|
||||
# Gaming packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Launchers
|
||||
lutris
|
||||
heroic
|
||||
# bottles
|
||||
|
||||
# Tools
|
||||
mangohud # FPS overlay
|
||||
# gamescope # Gaming compositor
|
||||
# protonup-qt # Proton version manager
|
||||
|
||||
# Communication
|
||||
discord
|
||||
];
|
||||
|
||||
# This value determines the NixOS release compatibility
|
||||
system.stateVersion = "24.05";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue