Add NixOS dual-configuration setup (dev and gaming profiles)
Co-authored-by: ragusa-it <196988693+ragusa-it@users.noreply.github.com>
This commit is contained in:
170
modules/common.nix
Normal file
170
modules/common.nix
Normal file
@@ -0,0 +1,170 @@
|
||||
{ config, pkgs, inputs, system, ... }:
|
||||
|
||||
{
|
||||
# --------------------------------------------------------------------------
|
||||
# BOOT
|
||||
# --------------------------------------------------------------------------
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# SYSTEM
|
||||
# --------------------------------------------------------------------------
|
||||
# IMPORTANT: Replace with actual values
|
||||
networking.hostName = "<hostname>";
|
||||
time.timeZone = "<timezone>";
|
||||
i18n.defaultLocale = "<locale>";
|
||||
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# AMD GPU - RDNA 4 (RX 9060 XT) + Zen 3 CPU (5700G)
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
# CRITICAL: RDNA 4 requires navi44 firmware blobs
|
||||
hardware.enableAllFirmware = true;
|
||||
|
||||
# Use the modern amdgpu NixOS module (cleaner than manual initrd config)
|
||||
hardware.amdgpu.initrd.enable = true;
|
||||
|
||||
hardware.graphics = {
|
||||
enable = true;
|
||||
enable32Bit = true; # Required for Steam/Wine
|
||||
extraPackages = with pkgs; [
|
||||
rocmPackages.clr.icd # OpenCL support for RDNA 4
|
||||
];
|
||||
# NOTE: AMDVLK intentionally omitted
|
||||
# Some games auto-select AMDVLK over RADV, causing performance issues
|
||||
# RADV (Mesa) is the default and performs better for gaming
|
||||
};
|
||||
|
||||
# RADV is already the default Vulkan driver
|
||||
# This variable is optional but makes it explicit
|
||||
environment.variables.AMD_VULKAN_ICD = "RADV";
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# CPU - Zen 3 Optimizations (Ryzen 7 5700G)
|
||||
# --------------------------------------------------------------------------
|
||||
boot.kernelParams = [
|
||||
"amd_pstate=active" # Better power/performance scaling on Zen 3
|
||||
];
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# MOTHERBOARD - MSI B550 Tomahawk Sensors
|
||||
# --------------------------------------------------------------------------
|
||||
boot.kernelModules = [ "nct6775" ]; # B550 hardware monitoring
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# MANGOWC + NOCTALIA
|
||||
# --------------------------------------------------------------------------
|
||||
programs.mango.enable = true;
|
||||
|
||||
# Required for screen sharing, file dialogs
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
wlr.enable = true;
|
||||
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
|
||||
};
|
||||
|
||||
# Enable seatd for session management
|
||||
services.seatd.enable = true;
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# USER ACCOUNT
|
||||
# --------------------------------------------------------------------------
|
||||
# IMPORTANT: Replace <username> with actual username
|
||||
users.users.<username> = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" "networkmanager" "video" "seat" ];
|
||||
# Set initial password or use hashedPassword
|
||||
initialPassword = "changeme";
|
||||
packages = with pkgs; [
|
||||
# -- Noctalia Shell --
|
||||
inputs.quickshell.packages.${system}.default
|
||||
inputs.noctalia.packages.${system}.default
|
||||
brightnessctl
|
||||
cliphist
|
||||
wlsunset
|
||||
|
||||
# -- MangoWC Ecosystem --
|
||||
foot # Terminal
|
||||
wmenu # Launcher
|
||||
wl-clipboard # Clipboard
|
||||
grim # Screenshot
|
||||
slurp # Region selection
|
||||
swaybg # Wallpaper
|
||||
|
||||
# -- Applications --
|
||||
firefox
|
||||
];
|
||||
};
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# SYSTEM PACKAGES
|
||||
# --------------------------------------------------------------------------
|
||||
environment.systemPackages = with pkgs; [
|
||||
vim
|
||||
wget
|
||||
curl
|
||||
htop
|
||||
git
|
||||
unzip
|
||||
file
|
||||
|
||||
# GPU verification tools
|
||||
clinfo # Verify OpenCL: clinfo
|
||||
vulkan-tools # Verify Vulkan: vulkaninfo
|
||||
pciutils # lspci for hardware info
|
||||
];
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# FONTS
|
||||
# --------------------------------------------------------------------------
|
||||
fonts.packages = with pkgs; [
|
||||
# Nerd fonts - syntax changed in NixOS 25.05+
|
||||
# Old syntax was: (nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
|
||||
# New syntax is individual packages:
|
||||
nerd-fonts.jetbrains-mono
|
||||
|
||||
# Other fonts
|
||||
inter
|
||||
roboto
|
||||
];
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# AUDIO (PipeWire)
|
||||
# --------------------------------------------------------------------------
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
|
||||
# Disable PulseAudio (conflicts with PipeWire)
|
||||
hardware.pulseaudio.enable = false;
|
||||
|
||||
# RealtimeKit for PipeWire
|
||||
security.rtkit.enable = true;
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# MISC
|
||||
# --------------------------------------------------------------------------
|
||||
# Allow unfree packages (needed for Steam, some drivers)
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# Enable flakes
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
|
||||
# Garbage collection
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 14d";
|
||||
};
|
||||
|
||||
# IMPORTANT: Set to the NixOS version of your install media
|
||||
# Check with: nixos-version
|
||||
# Do NOT change this after initial install
|
||||
system.stateVersion = "25.05";
|
||||
}
|
||||
86
modules/dev.nix
Normal file
86
modules/dev.nix
Normal file
@@ -0,0 +1,86 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
# Identification tag (shows in boot menu and `nixos-version`)
|
||||
system.nixos.tags = [ "dev" ];
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# KERNEL - Latest stable for RDNA 4 GPU support
|
||||
# --------------------------------------------------------------------------
|
||||
# NOTE: LTS kernels often lag behind new GPU support.
|
||||
# For RDNA 4 (RX 9060 XT), use linuxPackages_latest instead of linuxPackages.
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# DOCKER
|
||||
# --------------------------------------------------------------------------
|
||||
virtualisation.docker = {
|
||||
enable = true;
|
||||
autoPrune = {
|
||||
enable = true;
|
||||
dates = "weekly";
|
||||
};
|
||||
};
|
||||
|
||||
# IMPORTANT: Replace <username> with actual username
|
||||
users.users.<username>.extraGroups = [ "docker" ];
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# DEVELOPMENT TOOLS
|
||||
# --------------------------------------------------------------------------
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true; # Caches nix shells
|
||||
};
|
||||
|
||||
# IMPORTANT: Replace <username> with actual username
|
||||
users.users.<username>.packages = with pkgs; [
|
||||
# -- Git --
|
||||
lazygit
|
||||
gh # GitHub CLI
|
||||
|
||||
# -- Node.js --
|
||||
nodejs_22
|
||||
nodePackages.pnpm
|
||||
nodePackages.yarn
|
||||
|
||||
# -- CLI Tools --
|
||||
httpie # HTTP client
|
||||
jq # JSON processor
|
||||
yq # YAML processor
|
||||
fd # Find alternative
|
||||
ripgrep # Grep alternative
|
||||
eza # ls alternative
|
||||
bat # cat alternative
|
||||
fzf # Fuzzy finder
|
||||
zoxide # cd alternative
|
||||
delta # Git diff viewer
|
||||
|
||||
# -- Database Clients --
|
||||
postgresql # psql client
|
||||
# redis # Uncomment if needed
|
||||
|
||||
# -- Misc --
|
||||
gnumake
|
||||
gcc
|
||||
];
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# SERVICES (Optional - uncomment if needed)
|
||||
# --------------------------------------------------------------------------
|
||||
# Local PostgreSQL
|
||||
# services.postgresql = {
|
||||
# enable = true;
|
||||
# ensureDatabases = [ "devdb" ];
|
||||
# ensureUsers = [{
|
||||
# name = "<username>";
|
||||
# ensureDBOwnership = true;
|
||||
# }];
|
||||
# };
|
||||
|
||||
# Local Redis
|
||||
# services.redis.servers."dev" = {
|
||||
# enable = true;
|
||||
# port = 6379;
|
||||
# };
|
||||
}
|
||||
98
modules/gaming.nix
Normal file
98
modules/gaming.nix
Normal file
@@ -0,0 +1,98 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
# Identification tags (shows in boot menu)
|
||||
system.nixos.tags = [ "gaming" "zen" ];
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# KERNEL - Zen for gaming performance
|
||||
# --------------------------------------------------------------------------
|
||||
boot.kernelPackages = pkgs.linuxPackages_zen;
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# STEAM
|
||||
# --------------------------------------------------------------------------
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
gamescopeSession.enable = true;
|
||||
remotePlay.openFirewall = true;
|
||||
dedicatedServer.openFirewall = true;
|
||||
};
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# GAMEMODE - Auto performance optimizations
|
||||
# --------------------------------------------------------------------------
|
||||
programs.gamemode = {
|
||||
enable = true;
|
||||
enableRenice = true;
|
||||
settings = {
|
||||
general = {
|
||||
renice = 10;
|
||||
};
|
||||
gpu = {
|
||||
apply_gpu_optimisations = "accept-responsibility";
|
||||
gpu_device = 0;
|
||||
amd_performance_level = "high";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# CORECTRL - AMD GPU Control
|
||||
# --------------------------------------------------------------------------
|
||||
programs.corectrl = {
|
||||
enable = true;
|
||||
gpuOverclock = {
|
||||
enable = true;
|
||||
ppfeaturemask = "0xffffffff";
|
||||
};
|
||||
};
|
||||
|
||||
# IMPORTANT: Replace <username> with actual username
|
||||
users.users.<username>.extraGroups = [ "corectrl" "gamemode" ];
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# GAMING PACKAGES
|
||||
# --------------------------------------------------------------------------
|
||||
# IMPORTANT: Replace <username> with actual username
|
||||
users.users.<username>.packages = with pkgs; [
|
||||
# -- Performance Overlays --
|
||||
mangohud # FPS counter, GPU stats
|
||||
goverlay # MangoHud GUI config
|
||||
|
||||
# -- Game Launchers --
|
||||
lutris # Multi-platform launcher
|
||||
heroic # Epic/GOG launcher
|
||||
bottles # Wine prefix manager
|
||||
|
||||
# -- Proton/Wine --
|
||||
protonup-qt # Proton-GE installer
|
||||
winetricks
|
||||
protontricks
|
||||
|
||||
# -- Utilities --
|
||||
gamescope # Micro-compositor for gaming
|
||||
corectrl # AMD GPU control GUI
|
||||
|
||||
# -- Optional Game Clients --
|
||||
# prismlauncher # Minecraft
|
||||
# retroarch # Emulation
|
||||
];
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# KERNEL PARAMETERS - Gaming optimizations
|
||||
# --------------------------------------------------------------------------
|
||||
boot.kernel.sysctl = {
|
||||
# Reduce swappiness for gaming
|
||||
"vm.swappiness" = 10;
|
||||
# Increase max map count (needed for some games)
|
||||
"vm.max_map_count" = 2147483642;
|
||||
};
|
||||
|
||||
# Additional kernel params for gaming (appends to common.nix params)
|
||||
boot.kernelParams = [
|
||||
"amd_pstate=active" # Inherited from common, but explicit for clarity
|
||||
"mitigations=off" # Optional: Disable CPU mitigations for ~5% perf gain
|
||||
# Remove this line if security is a concern
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user