Files
nixos/configuration.nix
Melvin Ragusa cbdffb05be fix automount
2026-02-03 11:21:54 +01:00

264 lines
11 KiB
Nix

# configuration.nix
# Main NixOS configuration - imports modular components
{
config,
pkgs,
inputs,
lib,
username,
...
}:
{
imports = [
# Hardware
./hardware-configuration.nix
# Modular configuration
./modules/desktop.nix # Portal, polkit, launcher, lock, wallpaper
./modules/gpu-amd.nix # AMD graphics, Vulkan, VA-API
./modules/audio.nix # Bluetooth, audio controls
./modules/gaming.nix # Steam, Gamemode, Lutris, etc.
./modules/apps.nix # User applications
./modules/dev.nix # Docker, dev tools
./modules/theming.nix # Fonts, themes, cursors
# ./modules/virtualization.nix # QEMU, KVM, virt-manager
./modules/power.nix # Power management, CPU governors
./modules/shell.nix # Fish shell configuration
./modules/services.nix # System services (fstrim, zram, avahi, psd)
./modules/navidrome.nix # Music streaming server
];
# ═══════════════════════════════════════════════════════════════
# SECONDARY STORAGE
# ═══════════════════════════════════════════════════════════════
fileSystems."/mnt/Intenso-SSD" = {
device = "/dev/disk/by-uuid/51c56376-8384-4762-a8e9-8151fe91173b";
fsType = "ext4";
options = [ "defaults" "nofail" "x-gvfs-show" ];
};
fileSystems."/mnt/Samsung-SSD" = {
device = "/dev/disk/by-uuid/343ea612-9305-4fb6-9d4c-7a7ca8b0e72c";
fsType = "ext4";
options = [ "defaults" "nofail" "x-gvfs-show" ];
};
fileSystems."/mnt/Extern-SSD" = {
device = "/dev/disk/by-uuid/4e233c88-e91b-480c-b795-6fffc1fbdc69";
fsType = "ext4";
options = [ "defaults" "nofail" "x-gvfs-show" ];
};
# ═══════════════════════════════════════════════════════════════
# BOOT
# ═══════════════════════════════════════════════════════════════
# ─── Bootloader: Limine with Secure Boot ───
boot.loader.systemd-boot.enable = false; # Disabled - using Limine
boot.loader.limine.enable = true;
boot.loader.limine.secureBoot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# ─── Kernel ───
boot.kernelPackages = pkgs.cachyosKernels.linuxPackages-cachyos-latest-x86_64-v3;
# Kernel parameters (consolidated from modules)
boot.kernelParams = [
"amd_pstate=active" # Modern Ryzen power management (from power.nix)
"amdgpu.ppfeaturemask=0xffffffff" # Full AMD GPU power features (from gpu-amd.nix)
];
# ─── Scheduler ───
# sched-ext scheduler for gaming performance
services.scx.enable = true;
services.scx.scheduler = "scx_lavd"; # Low-latency scheduler, good for gaming
# ─── Hibernation ───
# Resume from encrypted swap (cryptswap must be unlocked before resume)
boot.resumeDevice = "/dev/mapper/cryptswap";
# ═══════════════════════════════════════════════════════════════
# NETWORKING
# ═══════════════════════════════════════════════════════════════
networking.hostName = "nix";
networking.networkmanager.enable = true;
# ═══════════════════════════════════════════════════════════════
# LOCALIZATION
# ═══════════════════════════════════════════════════════════════
time.timeZone = "Europe/Berlin";
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8";
};
console.keyMap = "de-latin1-nodeadkeys";
# ═══════════════════════════════════════════════════════════════
# DISPLAY & INPUT
# ═══════════════════════════════════════════════════════════════
services.xserver.enable = true;
services.displayManager.ly.enable = true;
services.displayManager.defaultSession = "niri";
services.xserver.xkb = {
layout = "de";
variant = "nodeadkeys";
};
# ═══════════════════════════════════════════════════════════════
# AUDIO (PipeWire)
# ═══════════════════════════════════════════════════════════════
services.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true; # For pro audio apps
};
# ═══════════════════════════════════════════════════════════════
# BLUETOOTH
# ═══════════════════════════════════════════════════════════════
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
settings = {
General = {
Enable = "Source,Sink,Media,Socket";
Experimental = true;
KernelExperimental = true;
};
Policy = {
AutoEnable = true;
};
};
};
# ═══════════════════════════════════════════════════════════════
# PRINTING
# ═══════════════════════════════════════════════════════════════
services.printing.enable = true;
# ═══════════════════════════════════════════════════════════════
# USER
# ═══════════════════════════════════════════════════════════════
users.users.${username} = {
isNormalUser = true;
description = "Melvin Ragusa";
extraGroups = [
"wheel" # Sudo access
"networkmanager" # Network configuration
# Additional groups are added by modules:
# - docker (dev.nix)
# - gamemode (gaming.nix)
# - corectrl (gpu-amd.nix)
];
shell = pkgs.fish; # Fish shell (migrated from Arch)
};
# ═══════════════════════════════════════════════════════════════
# PROGRAMS
# ═══════════════════════════════════════════════════════════════
programs.zsh.enable = true; # Keep zsh available as fallback
programs.yazi.enable = true;
programs.firefox.enable = true;
programs.niri.enable = true;
# ═══════════════════════════════════════════════════════════════
# NIX SETTINGS
# ═══════════════════════════════════════════════════════════════
nix.settings = {
experimental-features = [
"nix-command"
"flakes"
];
# Optimize storage
auto-optimise-store = true;
# Trust users for substituters
trusted-users = [
"root"
"@wheel"
];
};
# Garbage collection
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 14d";
};
nixpkgs.config.allowUnfree = true;
# ═══════════════════════════════════════════════════════════════
# SYSTEM PACKAGES (Base essentials)
# ═══════════════════════════════════════════════════════════════
environment.systemPackages = with pkgs; [
# Core utilities
fastfetch
micro
wget
curl
# Secure Boot management
sbctl
# Nix tools
nil # Nix LSP
nixd
# Wayland
xwayland-satellite
grim
slurp
# File management
nautilus
# Editors
zed-editor
# Browser
inputs.zen-browser.packages.${pkgs.system}.default
# Flake inputs (desktop shell)
inputs.noctalia.packages.${pkgs.system}.default
inputs.opencode.packages.${pkgs.system}.default
# Terminal
ghostty
# AI coding
claude-code
# Package managers
pnpm
];
# ═══════════════════════════════════════════════════════════════
# SERVICES
# ═══════════════════════════════════════════════════════════════
services.openssh.enable = true;
services.tailscale.enable = true;
# ═══════════════════════════════════════════════════════════════
# SYSTEM
# ═══════════════════════════════════════════════════════════════
system.stateVersion = "26.05";
}