From 65a547ad1a5e2458891cf65114594f237216107e Mon Sep 17 00:00:00 2001 From: magges Date: Tue, 16 Jun 2026 20:55:00 +0200 Subject: [PATCH] Initial template repo --- README.md | 387 ++++++++++++++++++ configuration.nix | 67 ++++ docs/CACHIX_ANLEITUNG.md | 376 ++++++++++++++++++ docs/COSMIC_SETUP_ANLEITUNG.md | 294 ++++++++++++++ docs/GAMING_CUSTOMIZATION_GUIDE.md | 507 ++++++++++++++++++++++++ docs/KERNEL_GAMING_TWEAKS.md | 171 ++++++++ docs/MESA_GIT_ANLEITUNG.md | 346 ++++++++++++++++ docs/PODMAN_DISTROBOX.md | 376 ++++++++++++++++++ docs/SETUP_FUER_FREUNDE.md | 446 +++++++++++++++++++++ flake.nix | 31 ++ hardware-configuration.nix | 9 + install-proton-cachyos.sh | 31 ++ install-proton-ge.sh | 31 ++ modules/audio/pipewire.nix | 20 + modules/base.nix | 79 ++++ modules/chaotic-nyx.nix | 16 + modules/containers/podman-distrobox.nix | 20 + modules/desktop/budgie.nix | 6 + modules/desktop/common.nix | 9 + modules/desktop/cosmic-max.nix | 39 ++ modules/desktop/cosmic.nix | 25 ++ modules/desktop/gnome.nix | 11 + modules/desktop/hyprland.nix | 20 + modules/desktop/kde.nix | 12 + modules/flatpak.nix | 13 + modules/gaming-tweaks.nix | 26 ++ modules/gaming.nix | 33 ++ modules/gaming/wine-proton.nix | 43 ++ modules/graphics/mesa-amd-opencl.nix | 29 ++ modules/graphics/mesa-amd.nix | 20 + modules/graphics/nvidia-open.nix | 22 + modules/graphics/nvidia.nix | 22 + modules/kernel/linux-cachyos.nix | 10 + modules/kernel/linux-default.nix | 8 + modules/kernel/linux-hardened.nix | 9 + modules/kernel/linux-xanmod.nix | 10 + modules/kernel/linux-zen.nix | 9 + modules/packages.nix | 24 ++ modules/peripherals.nix | 21 + 39 files changed, 3628 insertions(+) create mode 100644 README.md create mode 100644 configuration.nix create mode 100644 docs/CACHIX_ANLEITUNG.md create mode 100644 docs/COSMIC_SETUP_ANLEITUNG.md create mode 100644 docs/GAMING_CUSTOMIZATION_GUIDE.md create mode 100644 docs/KERNEL_GAMING_TWEAKS.md create mode 100644 docs/MESA_GIT_ANLEITUNG.md create mode 100644 docs/PODMAN_DISTROBOX.md create mode 100644 docs/SETUP_FUER_FREUNDE.md create mode 100644 flake.nix create mode 100644 hardware-configuration.nix create mode 100755 install-proton-cachyos.sh create mode 100755 install-proton-ge.sh create mode 100644 modules/audio/pipewire.nix create mode 100644 modules/base.nix create mode 100644 modules/chaotic-nyx.nix create mode 100644 modules/containers/podman-distrobox.nix create mode 100644 modules/desktop/budgie.nix create mode 100644 modules/desktop/common.nix create mode 100644 modules/desktop/cosmic-max.nix create mode 100644 modules/desktop/cosmic.nix create mode 100644 modules/desktop/gnome.nix create mode 100644 modules/desktop/hyprland.nix create mode 100644 modules/desktop/kde.nix create mode 100644 modules/flatpak.nix create mode 100644 modules/gaming-tweaks.nix create mode 100644 modules/gaming.nix create mode 100644 modules/gaming/wine-proton.nix create mode 100644 modules/graphics/mesa-amd-opencl.nix create mode 100644 modules/graphics/mesa-amd.nix create mode 100644 modules/graphics/nvidia-open.nix create mode 100644 modules/graphics/nvidia.nix create mode 100644 modules/kernel/linux-cachyos.nix create mode 100644 modules/kernel/linux-default.nix create mode 100644 modules/kernel/linux-hardened.nix create mode 100644 modules/kernel/linux-xanmod.nix create mode 100644 modules/kernel/linux-zen.nix create mode 100644 modules/packages.nix create mode 100644 modules/peripherals.nix diff --git a/README.md b/README.md new file mode 100644 index 0000000..33292d5 --- /dev/null +++ b/README.md @@ -0,0 +1,387 @@ +# NixOS Gaming Base + +Diese Basis-Config ist als wiederverwendbare Vorlage für ein NixOS-Gaming-Desktop-System gedacht und nutzt `nixos-unstable`, `Chaotic-Nyx` und getrennte Desktop-/Treiber-Configs. Fokus: + +- aktueller Kernel +- umschaltbare Grafik-Configs für AMD oder Nvidia +- Chaotic `mesa-git` und 32-Bit-Libs für Steam/Proton +- PipeWire + Gaming-/Desktop-Audio-Tools +- Steam, Gamescope, MangoHud, Lutris, Heroic, LACT +- Basis für RGB- und Gaming-Peripherie +- Desktop-Auswahl zwischen KDE, GNOME, Budgie, Hyprland und COSMIC + +## Struktur + +- `flake.nix`: Einstieg über `nixos-unstable` + `chaotic-cx/nyx` +- `configuration.nix`: Host-spezifische Einstiegsdatei +- `modules/base.nix`: Boot, Locale, Nix, Firmware, Governor, Basis-Tweaks +- `modules/packages.nix`: zentraler Ort für eigene Zusatzpakete +- `modules/chaotic-nyx.nix`: Chaotic-Nyx Aktivierung, `allowUnfree`, `mesa-git` +- `modules/graphics/mesa-amd.nix`: AMDGPU + Mesa/RADV Basis +- `modules/graphics/mesa-amd-opencl.nix`: AMD mit AMDVLK + OpenCL/ROCm +- `modules/graphics/nvidia.nix`: Nvidia-Treiber Basis mit proprietären Modulen +- `modules/graphics/nvidia-open.nix`: Nvidia mit offenen Kernel-Modulen +- `modules/audio/pipewire.nix`: PipeWire, JACK, Pulse, Audio-Tools +- `modules/gaming.nix`: Steam, Gamescope, Launcher-Stack +- `modules/gaming/wine-proton.nix`: Wine-, Proton- und Compatibility-Tools +- `modules/containers/podman-distrobox.nix`: Podman Container Runtime + Distrobox +- `modules/kernel/linux-default.nix`: Standard Linux Kernel (stabil) +- `modules/kernel/linux-zen.nix`: Linux Zen (Gaming-optimiert) +- `modules/kernel/linux-hardened.nix`: Linux Hardened (Sicherheit) +- `modules/gaming-tweaks.nix`: optionale Extra-Parameter für Gaming-Performance +- `modules/kernel/linux-cachyos.nix`: aktiver Gaming-Kernel in `configuration.nix` +- `modules/desktop/common.nix`: gemeinsame Desktop-Pakete +- `modules/desktop/kde.nix`: KDE Plasma 6 + SDDM +- `modules/desktop/gnome.nix`: GNOME + GDM +- `modules/desktop/budgie.nix`: Budgie +- `modules/desktop/hyprland.nix`: Hyprland + SDDM +- `modules/desktop/cosmic.nix`: schlanke COSMIC-Basis +- `modules/desktop/cosmic-max.nix`: COSMIC DE + Cosmic-Greeter (Wayland-native) +- `modules/peripherals.nix`: RGB-, Maus- und USB-Helfer + +## Quick Start - So nutzt ihr dieses Repo + +Ihr möchtet diese Config für euer NixOS-Gaming-System nutzen? Hier geht's los: + +### 1. Repo klonen + +```bash +git clone ~/nixos-config +cd ~/nixos-config +``` + +### 2. Hardware-Konfiguration hinzufügen + +Nach einer frischen NixOS-Installation: + +```bash +sudo cp /etc/nixos/hardware-configuration.nix ./hardware-configuration.nix +``` + +### 3. Basis-Einstellungen anpassen (configuration.nix) + +Öffnet `configuration.nix` und ändert diese Werte: + +```nix +hostName = "euer-computer-name"; # z.B. "gaming-rig" +userName = "euer-nutzername"; # z.B. "max" +fullName = "Euer Name"; # z.B. "Max Mustermann" +``` + +### 4. Desktop und GPU wählen + +Ändert diese Zeilen nach eurer Hardware: + +```nix +desktopConfig = ./modules/desktop/kde.nix; # oder: cosmic-max.nix, gnome.nix, hyprland.nix +graphicsConfig = ./modules/graphics/mesa-amd.nix; # oder: nvidia.nix, nvidia-open.nix, mesa-amd-opencl.nix +kernelConfig = ./modules/kernel/linux-cachyos.nix; # oder: linux-zen.nix, linux-default.nix +enableExtraGamingTweaks = true; # false für konservativere Defaults +``` + +**Nicht sicher? Empfehlungen:** +- **AMD-GPU**: `mesa-amd.nix` + `kde.nix` +- **NVIDIA-GPU**: `nvidia.nix` + `kde.nix` +- **Modern/Wayland**: `cosmic-max.nix` (Achtung: weniger Gaming-optimiert als KDE) +- **Kernel**: `linux-cachyos.nix` für Gaming, `linux-zen.nix` als konservative Alternative + +### 5. System bauen + +```bash +sudo nixos-rebuild switch --flake .#template +sudo reboot +``` + +Das war's! Nach dem Neustart startet euer neues System. + +### Weitere Infos + +- **Gaming-Setup & Customization**: Siehe [`docs/GAMING_CUSTOMIZATION_GUIDE.md`](docs/GAMING_CUSTOMIZATION_GUIDE.md) +- **Zu COSMIC wechseln**: Siehe [`docs/COSMIC_SETUP_ANLEITUNG.md`](docs/COSMIC_SETUP_ANLEITUNG.md) +- **Mehr Pakete installieren**: Edit `modules/packages.nix` + +## Vorlage anpassen + +Die wichtigsten Platzhalter stehen direkt in `configuration.nix`: + +```nix +hostName = "example-host"; +userName = "gamer"; +fullName = "Gaming User"; +``` + +Passe diese Werte vor dem ersten Build an. In `modules/base.nix` sind `Europe/Berlin`, `de_DE.UTF-8` und `de` als Defaults gesetzt und können überschrieben werden. +Zusätzliche allgemeine Pakete kannst du in `modules/packages.nix` eintragen. + +## Desktop und GPU auswählen + +Die Auswahl passiert direkt oben in `configuration.nix`. Du änderst diese Zeilen: + +```nix +desktopConfig = ./modules/desktop/kde.nix; +graphicsConfig = ./modules/graphics/mesa-amd.nix; +kernelConfig = ./modules/kernel/linux-cachyos.nix; +enableExtraGamingTweaks = true; +``` + +Für den Desktop sind diese Werte möglich: + +- `./modules/desktop/kde.nix` +- `./modules/desktop/gnome.nix` +- `./modules/desktop/budgie.nix` +- `./modules/desktop/hyprland.nix` +- `./modules/desktop/cosmic.nix` +- `./modules/desktop/cosmic-max.nix` + +Für die GPU bzw. den Treiber sind diese Werte möglich: + +- `./modules/graphics/mesa-amd.nix` +- `./modules/graphics/mesa-amd-opencl.nix` +- `./modules/graphics/nvidia.nix` +- `./modules/graphics/nvidia-open.nix` + +Beispiele: + +KDE + AMD + +```nix +desktopConfig = ./modules/desktop/kde.nix; +graphicsConfig = ./modules/graphics/mesa-amd.nix; +``` + +KDE + AMD mit OpenCL/AMDVLK + +```nix +desktopConfig = ./modules/desktop/kde.nix; +graphicsConfig = ./modules/graphics/mesa-amd-opencl.nix; +``` + +GNOME + Nvidia + +```nix +desktopConfig = ./modules/desktop/gnome.nix; +graphicsConfig = ./modules/graphics/nvidia.nix; +``` + +Hyprland + Nvidia + +```nix +desktopConfig = ./modules/desktop/hyprland.nix; +graphicsConfig = ./modules/graphics/nvidia.nix; +``` + +KDE + Nvidia Open Kernel Module + +```nix +desktopConfig = ./modules/desktop/kde.nix; +graphicsConfig = ./modules/graphics/nvidia-open.nix; +``` + +COSMIC (Modern Wayland-Native) + AMD + +```nix +desktopConfig = ./modules/desktop/cosmic.nix; +graphicsConfig = ./modules/graphics/mesa-amd.nix; +``` + +COSMIC Max + AMD + +```nix +desktopConfig = ./modules/desktop/cosmic-max.nix; +graphicsConfig = ./modules/graphics/mesa-amd.nix; +``` + +COSMIC Max + Nvidia + +```nix +desktopConfig = ./modules/desktop/cosmic-max.nix; +graphicsConfig = ./modules/graphics/nvidia.nix; +``` + +Es wird dabei immer genau ein Desktop-Modul und genau ein Grafik-Modul importiert, nicht alle auf einmal. +In `modules/graphics/nvidia.nix` sind `modesetting`, `nvidiaSettings` und `nvidiaPackages.latest` bereits gesetzt. + +## Kernel auswählen + +Der aktive Kernel wird in `configuration.nix` über `kernelConfig` gewählt. Standard in diesem Repo ist CachyOS: + +```nix +kernelConfig = ./modules/kernel/linux-cachyos.nix; +``` + +Empfehlungen: + +- `linux-cachyos.nix`: beste Standardwahl für diesen Gaming-Desktop +- `linux-zen.nix`: konservative Gaming-Alternative, wenn CachyOS Probleme macht +- `linux-default.nix`: stabiler Fallback +- `linux-hardened.nix`: Security-Fokus, nicht ideal für Gaming +- `linux-xanmod.nix`: experimenteller Performance-Kernel + +Weitere Details stehen in [`docs/KERNEL_GAMING_TWEAKS.md`](docs/KERNEL_GAMING_TWEAKS.md). + +### Empfehlung für AMD + +- `mesa-amd.nix` ist die einfachste und sinnvollste Standardwahl für die meisten Gaming-Systeme mit AMD. +- `mesa-amd-opencl.nix` ist interessant, wenn du zusätzlich OpenCL/ROCm brauchst oder explizit AMDVLK testen willst. +- Wenn du nur spielen willst und keinen speziellen Compute- oder Vulkan-Workaround brauchst, nimm zuerst `mesa-amd.nix`. + +### Empfehlung für Nvidia + +- `nvidia.nix` ist die Standardwahl für die meisten Systeme, wenn du maximale Kompatibilität mit aktuellen Spielen willst. +- `nvidia-open.nix` ist für Systeme gedacht, auf denen du die offenen Nvidia-Kernel-Module nutzen möchtest. +- Wenn du nicht gezielt testen willst, nimm zuerst `nvidia.nix`. + +### Empfehlung für COSMIC + +- `cosmic.nix` ist die schlanke COSMIC-Variante mit den wichtigsten Desktop-Helfern. +- `cosmic-max.nix` ist die vollere COSMIC-Variante mit zusätzlichen COSMIC-Tools und Applets. +- Geeignet für Linux-Puristen und AMD-Benutzer; mit XWayland-Fallback auch für NVIDIA möglich. +- Wenn du einfach nur COSMIC nutzen willst, starte mit `cosmic.nix`. +- Wenn du gezielt die COSMIC-Extras willst, nimm `cosmic-max.nix`. +- Gaming: 7/10 – Solide für Linux-Native und Proton-Spiele, aber weniger spezialisiert als KDE. +- Tipp: Für maximale Gaming-Kompatibilität und Tweakbarkeit nimm KDE Plasma statt COSMIC. + +## Wine und Proton + +Die Wine-/Proton-Helfer liegen jetzt in `modules/gaming/wine-proton.nix` und werden automatisch über `modules/gaming.nix` importiert. + +Enthalten sind aktuell: + +- `wineWow64Packages.stable` +- `winetricks` +- `protontricks` +- `protonplus` +- `umu-launcher` +- `dxvk` +- `vkd3d-proton` +- `steam-run` + +Damit hast du direkt die typischen Werkzeuge für: + +- Steam Proton mit `protontricks` +- zusätzliche Compatibility Tools über `protonplus` +- Wine-/Non-Steam-Starts über `umu-launcher` +- manuelles Debugging und Prefix-Arbeit mit `winetricks` + +## Chaotic-Nyx & Mesa-Git + +Die Flake bindet `github:chaotic-cx/nyx/nyxpkgs-unstable` direkt ein und importiert +`chaotic.nixosModules.default`. + +**Mesa-Git aktivieren/deaktivieren:** Siehe `modules/chaotic-nyx.nix` und die Datei [`docs/MESA_GIT_ANLEITUNG.md`](docs/MESA_GIT_ANLEITUNG.md). + +**Was ist Mesa-Git?** +- Neueste tägliche GPU-Treiber-Builds von der Mesa-Entwicklung +- Ideal für moderne AMD-GPUs mit aktuellen Spielen +- Fallback-Option falls Probleme auftreten +- **Wichtig:** NVIDIA-Nutzer brauchen Mesa-Git nicht (benutzen proprietäre Treiber) + +## Nach der Installation + +1. Die vom Installer erzeugte `hardware-configuration.nix` nach `./hardware-configuration.nix` kopieren. +2. `hostName`, `userName` und `fullName` in `configuration.nix` anpassen. +3. In `configuration.nix` `desktopConfig` und `graphicsConfig` auf die gewünschten Module setzen. +4. Optional Locale, Tastatur und Zeitzone anpassen. +5. Passwort für den Benutzer setzen: + +```bash +passwd +``` + +6. Optional die Flake-Inputs aktualisieren: + +```bash +nix flake update +``` + +7. System aktivieren: + +```bash +sudo nixos-rebuild switch --flake .#template +``` + +## Dokumentation & Guides + +Alle Guides sind im `docs/`-Verzeichnis. Wähle basierend auf deinem Bedarf: + +### 🚀 **[SETUP_FUER_FREUNDE.md](docs/SETUP_FUER_FREUNDE.md)** – Hier anfangen! +Komplette Schritt-für-Schritt Anleitung für alle, die dieses Repo nutzen möchten: +- Was beim Klonen passiert +- Warum `flake.lock` im Repo mit versioniert ist +- `nixos-unstable` vs `nixos-stable` erklärt +- Kompletter Setup-Prozess (Phase 1-4) +- Häufige Probleme & Lösungen +- **👉 Hier sollten Freunde ZUERST nachschauen!** + +### 🏎️ **[CACHIX_ANLEITUNG.md](docs/CACHIX_ANLEITUNG.md)** – Schnellere Builds +Wie Cachix & vorkompilierte Pakete funktionieren: +- Was ist Cachix? (vorkompilierte Binaries) +- Warum ist es im Repo aktiviert? +- Performance: 90 Min → 15-30 Min (4-6x schneller!) +- Cache-Status prüfen +- Optional: Eigene Caches erstellen +- **👉 Wichtig zu wissen für schnellere Builds!** + +### 🎮 **[GAMING_CUSTOMIZATION_GUIDE.md](docs/GAMING_CUSTOMIZATION_GUIDE.md)** – Gaming & Anpassung +Alles zum Gaming-Setup und Desktop-Customization: +- Steam & Proton einrichten +- GameMode & Performance-Tools +- Desktop-spezifische Customization (KDE, GNOME, Hyprland, COSMIC) +- Performance-Optimierungen +- Troubleshooting Spiele-Probleme +- **👉 Nachdem das System läuft, hier Tipps holen!** + +### 🚀 **[MESA_GIT_ANLEITUNG.md](docs/MESA_GIT_ANLEITUNG.md)** – GPU-Treiber +Erklärung von Mesa-Git (neueste GPU-Treiber): +- Was ist Mesa-Git? (Tägliche GPU-Treiber-Updates) +- Warum es in der Config ist +- Wie man es aktiviert/deaktiviert +- Fallback-Specialisation (Auto-Fallback bei Crashes) +- Performance-Unterschiede +- Für welche GPUs geeignet (AMD ja, NVIDIA nein) +- **👉 Für AMD-Nutzer interessant, NVIDIA-Nutzer können skippen!** + +### 🌀 **[COSMIC_SETUP_ANLEITUNG.md](docs/COSMIC_SETUP_ANLEITUNG.md)** – COSMIC Desktop +Spezielle Anleitung für den Umstieg zu COSMIC DE: +- Installation & erste Einrichtung +- Gaming-Setup mit COSMIC +- Customization (Themes, Shortcuts, Tools) +- Troubleshooting +- **👉 Nur wenn ihr zu COSMIC wechseln möchtet!** + +### ⚙️ **[KERNEL_GAMING_TWEAKS.md](docs/KERNEL_GAMING_TWEAKS.md)** – Kernel & Performance +Kernel-Auswahl und Gaming-Optimierungen: +- Linux Default, Zen, Hardened erklärt +- Kernel wechseln +- Gaming-Tweaks (CPU-Governor, Network-Buffer, etc.) +- Performance-Vergleich +- **👉 Für maximale Gaming-Performance!** + +### 📦 **[PODMAN_DISTROBOX.md](docs/PODMAN_DISTROBOX.md)** – Container +Podman & Distrobox für Container-Workloads: +- Was ist Podman? (Docker-Ersatz) +- Was ist Distrobox? (einfache Container) +- Praktische Beispiele +- Troubleshooting +- **👉 Falls du Container brauchst (nicht für Gaming!)** + +--- + +## Schnelle Orientierung + +| Situation | Lies das... | +|-----------|-----------| +| Bin neu und weiß nicht, wo anfangen | SETUP_FUER_FREUNDE.md | +| Mein Build dauert zu lange | CACHIX_ANLEITUNG.md | +| Ich will zocken / customizen | GAMING_CUSTOMIZATION_GUIDE.md | +| Fragen zu GPU-Treibern | MESA_GIT_ANLEITUNG.md | +| Ich möchte zu COSMIC wechseln | COSMIC_SETUP_ANLEITUNG.md | +| Ich will Kernel / Gaming-Performance optimieren | KERNEL_GAMING_TWEAKS.md | +| Ich brauche Container (Podman/Distrobox) | PODMAN_DISTROBOX.md | + +## Späterer Ausbau + +- Desktop-spezifische Pakete und Defaults weiter tunen, z. B. Autologin, Keyring-Policy, Flatpak +- OBS / Discord / OpenRGB-Profile / Fancontrol +- Btrfs-Subvolumes, Snapshots, Impermanence +- spezielle Kernel- oder Scheduler-Tweaks, falls du sie wirklich brauchst diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..ac4ef9b --- /dev/null +++ b/configuration.nix @@ -0,0 +1,67 @@ +{ lib, ... }: + +let + hostName = "example-host"; + userName = "gamer"; + fullName = "Gaming User"; + + # Desktop auswählen, indem du genau diese Zeile änderst: + # ./modules/desktop/kde.nix + # ./modules/desktop/gnome.nix + # ./modules/desktop/budgie.nix + # ./modules/desktop/hyprland.nix + # ./modules/desktop/cosmic.nix + # ./modules/desktop/cosmic-max.nix + desktopConfig = ./modules/desktop/kde.nix; + + # GPU/Treiber auswählen, indem du genau diese Zeile änderst: + # ./modules/graphics/mesa-amd.nix + # ./modules/graphics/mesa-amd-opencl.nix + # ./modules/graphics/nvidia.nix + # ./modules/graphics/nvidia-open.nix + graphicsConfig = ./modules/graphics/mesa-amd.nix; + + # Kernel auswählen (optional - Standard ist fein): + # ./modules/kernel/linux-default.nix (Standard, stabil) + # ./modules/kernel/linux-zen.nix (Gaming optimiert, empfohlen) + # ./modules/kernel/linux-hardened.nix (Security, langsamer) + # ./modules/kernel/linux-cachyos.nix + kernelConfig = ./modules/kernel/linux-cachyos.nix; + + # Zusätzliche Gaming-Tweaks aktivieren/deaktivieren. + enableExtraGamingTweaks = true; +in + +{ + imports = [ + ./hardware-configuration.nix + ./modules/base.nix + ./modules/packages.nix + ./modules/audio/pipewire.nix + ./modules/chaotic-nyx.nix + graphicsConfig + ./modules/desktop/common.nix + desktopConfig + ./modules/gaming.nix + ./modules/containers/podman-distrobox.nix # Optional: Container Support + kernelConfig # Kernel-Auswahl + ./modules/peripherals.nix + ./modules/flatpak.nix + ] ++ lib.optional enableExtraGamingTweaks ./modules/gaming-tweaks.nix; + + networking.hostName = hostName; + + users.users.${userName} = { + isNormalUser = true; + description = fullName; + extraGroups = [ + "wheel" + "networkmanager" + "audio" + "video" + "input" + ]; + }; + + system.stateVersion = "26.05"; +} diff --git a/docs/CACHIX_ANLEITUNG.md b/docs/CACHIX_ANLEITUNG.md new file mode 100644 index 0000000..dec8bf2 --- /dev/null +++ b/docs/CACHIX_ANLEITUNG.md @@ -0,0 +1,376 @@ +# Cachix Setup Anleitung + +Wie du Cachix nutzt, um deine NixOS-Builds massiv zu beschleunigen. + +--- + +## Was ist Cachix? + +**Cachix** = Vorkompilierte Nix-Pakete (wie ein Mirror/Cache). + +Statt alles selbst zu kompilieren: +``` +❌ Kompilieren (1-2 Stunden): + gcc + glibc + steam + mesa + ... = sehr lange + +✅ Mit Cachix (10-30 Min): + Download vorkompilierte Binaries = schnell! +``` + +--- + +## Cachix bereits im Repo aktiviert! ✅ + +Dieses Template nutzt bereits **Chaotic-Nyx Cachix**: + +**In `flake.nix`:** +```nix +nixConfig = { + extra-substituters = [ + "https://nyx-cache.chaotic.cx/" + ]; + extra-trusted-public-keys = [ + "nyx-cache.chaotic.cx:dJxTrgMC3V3cFfyIiBQDQorG6k1LsqurH/srpMSq7qk=" + ]; +}; +``` + +**Was das bedeutet:** +- ✅ `substituters` = Wo Binaries runterladen +- ✅ `trusted-public-keys` = Sichere Signatur für Cache +- ✅ Automatisch aktiviert, kein Setup nötig! + +**Performance-Gewinn:** +``` +Ohne Cachix (kompiliert alles lokal): 90+ Minuten +Mit Cachix (nutzt vorkompilierte Binaries): 15-30 Minuten +→ 5-6x schneller! +``` + +--- + +## Welche Caches sind aktiv? + +### Standard NixOS Cache + +Automatisch bei jedem NixOS: +``` +https://cache.nixos.org/ +``` + +**Was da ist:** +- Stabile nixpkgs-Pakete +- Offizielle NixOS-Binaries + +### Chaotic-Nyx Cache (Im Repo) + +``` +https://nyx-cache.chaotic.cx/ +``` + +**Was da ist:** +- Mesa-Git (neueste GPU-Treiber) +- Chaotic-Pakete +- Gaming-Tools (Steam, Proton, etc.) + +### Weitere Caches hinzufügen (Optional) + +Falls du mehr Caches willst (z.B. für andere Projekte): + +**In `flake.nix` ergänzen:** +```nix +nixConfig = { + extra-substituters = [ + "https://nyx-cache.chaotic.cx/" + "https://cache.nixos.org/" + "https://numtide.cachix.org" # Z.B. Devenv + ]; + extra-trusted-public-keys = [ + "nyx-cache.chaotic.cx:dJxTrgMC3V3cFfyIiBQDQorG6k1LsqurH/srpMSq7qk=" + "numtide.cachix.org-1:B7mY+4SOvX0nW0q6Z0i4N/BcL2RivchtA7yCNFrvW0s=" + ]; +}; +``` + +--- + +## Cachix System-Wide aktivieren + +Falls ihr später selbst Caches hinzufügen wollt: + +### Methode 1: In `flake.nix` (für dieses Repo) ✅ + +Wir nutzen das schon: +```nix +nixConfig = { ... } +``` + +### Methode 2: In `/etc/nix/nix.conf` (für alle Flakes) + +```bash +sudo nano /etc/nix/nix.conf +``` + +Hinzufügen: +```ini +substituters = https://cache.nixos.org/ https://nyx-cache.chaotic.cx/ +trusted-public-keys = nyx-cache.chaotic.cx:dJxTrgMC3V3cFfyIiBQDQorG6k1LsqurH/srpMSq7qk= +``` + +**Dann neuladen:** +```bash +sudo systemctl restart nix-daemon +``` + +--- + +## Cachix Performance-Check + +### Cache-Hits prüfen + +```bash +# Beim Build: Schau auf die Ausgabe +sudo nixos-rebuild switch --flake .#template + +# Output sollte zeigen: +# "copying path ... from 'https://nyx-cache.chaotic.cx/'" +# ^ Das bedeutet: Aus Cache heruntergeladen! + +# vs. + +# "building '/nix/store/...'" +# ^ Das bedeutet: Lokal kompiliert (no cache hit) +``` + +### Wie viele von Cache? + +```bash +# Nach Build überprüfen: +nix store ls -R /nix/store/... | wc -l + +# Ungefähr: Mit Cachix 50-60% Cache, 40-50% kompiliert +``` + +--- + +## Eigenen Cachix Cache erstellen (Advanced) + +Falls ihr einen Team-Cache bauen wollt: + +### Schritt 1: Cachix Account erstellen + +```bash +# Online: https://www.cachix.org/ +# Gratis Tier mit 5 GB +``` + +### Schritt 2: Cachix CLI installieren + +```bash +nix-shell -p cachix + +# Oder: +nix profile install nixpkgs#cachix +``` + +### Schritt 3: Authentifizieren + +```bash +cachix authtoken +# Token in https://app.cachix.org/tokens einsehen +# Eingeben wenn gefordert +``` + +### Schritt 4: Cache pushen + +```bash +# Nach erfolgreichen Build: +sudo nix copy --to "file:///tmp/nix-cache" /run/current-system + +# Dann zu Cachix: +cachix push my-cache /tmp/nix-cache +``` + +### Schritt 5: Im Repo nutzen + +```nix +# In flake.nix: +extra-substituters = [ + "https://my-cache.cachix.org" +]; +extra-trusted-public-keys = [ + "my-cache.cachix.org-1:XXXXX..." +]; +``` + +--- + +## Cachix mit `nix-direnv` (Workflow-Tipp) + +Falls ihr `nix-direnv` nutzt: + +```bash +# .envrc +use flake +``` + +**Das wird auf jeden Cache-Hit prüfen!** + +--- + +## Troubleshooting + +### Problem: Cache wird nicht genutzt (Alles wird kompiliert) + +**Ursache 1: Falsche Public Key** +```bash +# Überprüfe in flake.nix: +grep trusted-public-keys flake.nix +# Sollte exakt wie bei Cachix stehen +``` + +**Ursache 2: Cache-Server offline** +```bash +# Test: +curl -I https://nyx-cache.chaotic.cx/ + +# Falls 403/404: Cache hat Probleme +# → Fallback auf lokales Bauen: --no-substitute +``` + +**Ursache 3: Nix-Daemon nicht neugestartet** +```bash +sudo systemctl restart nix-daemon +``` + +### Problem: "Signature doesn't match" + +``` +Error: Signature doesn't match +``` + +**Lösung:** +```bash +# Public Key überprüfen: +echo "nyx-cache.chaotic.cx:dJxTrgMC3V3cFfyIiBQDQorG6k1LsqurH/srpMSq7qk=" | tee -a ~/.config/nix/nix.conf + +# Oder neu eingeben (exakt!) +``` + +### Problem: Zu langsam trotz Cache + +```bash +# 1. Cache-Status prüfen: +nix show-config substituters + +# 2. Parallele Jobs erhöhen: +sudo nano /etc/nix/nix.conf +# max-jobs = 8 +# cores = 8 + +# 3. Nix-Daemon neustarten: +sudo systemctl restart nix-daemon +``` + +--- + +## Performance-Vergleich + +### Ohne Cachix (Kompilieren) + +``` +$ sudo nixos-rebuild switch --flake .#template + +building '/nix/store/...-mesa-git' +building '/nix/store/...-steam' +building '/nix/store/...-gcc' + +[████████████░░░░░░░░░░░░░░░░░░░] 45% (90 min) +``` + +### Mit Cachix (Herunterladen) + +``` +$ sudo nixos-rebuild switch --flake .#template + +copying path from 'https://nyx-cache.chaotic.cx/' ... +copying path from 'https://nyx-cache.chaotic.cx/' ... + +[██████████████████████████████░░░] 95% (20 min) +``` + +--- + +## Für Freunde: Cachix Erklärung + +### Einfach: + +``` +"Cachix = vorkompilierte Pakete downloaden statt selbst bauen" + +Mit Cachix: 20 Minuten +Ohne Cachix: 90 Minuten +→ 4x schneller! +``` + +### Falls Freunde fragen: "Ist das sicher?" + +Antwort: +``` +Ja! Wir nutzen trusted-public-keys für digitale Signaturen. +Nur signierte Pakete vom Chaotic-Nyx Team werden installiert. +``` + +### Falls kein Internet: + +```bash +# Cachix funktioniert nur mit Internet +# Ohne Internet: --no-substitute +sudo nixos-rebuild switch --flake .#template --no-substitute +# (Dauert länger, aber funktioniert offline) +``` + +--- + +## Checkliste für Freunde + +- [ ] Cachix ist im Repo aktiviert (`flake.nix`) +- [ ] Beim ersten `nix flake update` wird Cache-Config geladen +- [ ] Beim `nixos-rebuild` sollte Cache genutzt werden +- [ ] Build dauert 15-30 Min (mit Cache), nicht 90+ Min +- [ ] Falls zu langsam: Cache ist wahrscheinlich offline → Fallback OK + +--- + +## Nützliche Commands + +```bash +# Cache-Status anzeigen +nix show-config substituters + +# System-Toplevel testweise bauen +nix build .#nixosConfigurations.template.config.system.build.toplevel + +# Fallback (kein Cache) +sudo nixos-rebuild switch --flake .#template --no-substitute + +# Cache räumen (alt Zeug löschen) +nix-collect-garbage -d + +# Speicher prüfen +df -h /nix +``` + +--- + +## Zusammenfassung + +| Punkt | Status | +|-------|--------| +| **Cachix aktiv?** | ✅ Ja (Chaotic-Nyx) | +| **Automatisch?** | ✅ Ja, kein Setup nötig | +| **Performance-Gewinn** | ✅ 4-6x schneller | +| **Sicher?** | ✅ Ja, signierte Pakete | +| **Für Freunde wichtig?** | ✅ Ja, erspart viel Build-Zeit | + +**Cachix ist schon aktiviert – einfach genießen!** 🚀 diff --git a/docs/COSMIC_SETUP_ANLEITUNG.md b/docs/COSMIC_SETUP_ANLEITUNG.md new file mode 100644 index 0000000..c248d30 --- /dev/null +++ b/docs/COSMIC_SETUP_ANLEITUNG.md @@ -0,0 +1,294 @@ +# COSMIC Desktop Umstieg - Schritt-für-Schritt Anleitung + +Anleitung zum Wechsel von deinem aktuellen NixOS 26.05 Setup zu COSMIC Desktop Environment. + +## Voraussetzungen + +- NixOS 26.05 installiert (✅ dein aktueller Stand) +- Zugriff auf Terminal/SSH +- Die Dateien im `~/nixos-config` Verzeichnis + +--- + +## Schritt 1: Backup erstellen + +Bevor wir Änderungen machen, ein Backup der aktuellen Konfiguration: + +```bash +cd ~/nixos-config +git status +git add -A +git commit -m "Backup vor COSMIC Umstieg" +``` + +**Was das macht:** +- Git speichert deinen aktuellen Zustand +- Falls etwas schiefgeht, kannst du mit `git revert` zurückgehen + +--- + +## Schritt 2: configuration.nix anpassen + +Öffne die Datei: +```bash +nano ~/nixos-config/configuration.nix +``` + +**Suche diese Zeile** (ca. Zeile 13): +```nix +desktopConfig = ./modules/desktop/kde.nix; +``` + +**Ändere sie zu:** +```nix +desktopConfig = ./modules/desktop/cosmic-max.nix; +``` + +**Speichern & Schließen:** +- Drücke `Ctrl+O` → `Enter` +- Drücke `Ctrl+X` + +--- + +## Schritt 3: Optional - GPU-Treiber überprüfen + +Für COSMIC empfohlen: AMD-Treiber oder NVIDIA 550+ + +**Aktuelle Einstellung überprüfen** (Zeile 20): +```nix +graphicsConfig = ./modules/graphics/mesa-amd.nix; +``` + +Falls du NVIDIA hast: +```nix +graphicsConfig = ./modules/graphics/nvidia-open.nix; +``` + +--- + +## Schritt 4: Flake.nix überprüfen + +Die `flake.nix` braucht keinen Umbau - sie hat schon alles für COSMIC: + +```bash +cat ~/nixos-config/flake.nix +``` + +✅ Sollte enthalten: +- `chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable"` (für aktuelle Pakete) +- Extra Substituter für `nyx-cache.chaotic.cx` + +Falls nicht: Die bestehende `flake.nix` ist optimal, brauchst nichts ändern. + +--- + +## Schritt 5: Update durchführen (Der wichtige Schritt!) + +Öffne Terminal im Projekt-Verzeichnis: + +```bash +cd ~/nixos-config +``` + +### Option A: Mit Flakes (EMPFOHLEN) + +```bash +sudo nixos-rebuild switch --flake .#template +``` + +**Was das macht:** +- Lädt alle Abhängigkeiten herunter +- Compiliert die neue Config +- Wechselt sofort zu COSMIC +- Dauert: 5-15 Minuten (je nach Internetverbindung & Hardware) + +### Option B: Ohne Flakes (Falls Probleme mit A) + +```bash +sudo nixos-rebuild switch -I nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos +``` + +--- + +## Schritt 6: System neu starten + +Nach erfolgreichem Build: + +```bash +sudo reboot +``` + +**Bei Neustart:** +- COSMIC-Greeter (Login-Bildschirm) sollte erscheinen +- Melde dich an +- COSMIC Desktop startet + +--- + +## Schritt 7: Überprüfung + +Nach dem Login, öffne ein Terminal (`Ctrl+Alt+T` oder über Launcher): + +```bash +# Zeigt dein aktuelles Desktop Environment +echo $DESKTOP_SESSION + +# Sollte zeigen: +# cosmic +``` + +Prüfe auch: +- **Systemeinstellungen** (cosmic-settings) funktionieren? +- **Dateiverwaltung** (cosmic-files) funktioniert? +- **Terminal** (cosmic-terminal) startet? + +--- + +## Troubleshooting + +### Problem: `error: flake not found` + +**Lösung:** +```bash +cd ~/nixos-config +nix flake update +sudo nixos-rebuild switch --flake .#template +``` + +### Problem: NVIDIA + schwarzer Bildschirm + +**Das ist normal beim ersten Start mit NVIDIA.** + +Lösung: +```bash +# Starte in TTY (Ctrl+Alt+F2) +# Melde dich an +sudo nixos-rebuild switch --flake .#template +sudo reboot +``` + +### Problem: COSMIC startet nicht / bleibt bei Login hängen + +**Fallback zu KDE:** +1. Öffne Terminal: `Ctrl+Alt+F2` +2. Melde dich an +3. Ändere `configuration.nix` zurück: + ```bash + nano ~/nixos-config/configuration.nix + # Ändere desktopConfig = ./modules/desktop/kde.nix; + ``` +4. Rebuild: `sudo nixos-rebuild switch --flake .#template` + +### Problem: `chaotic.nixosModules.default` nicht gefunden + +**Lösung - Flakes neuladen:** +```bash +cd ~/nixos-config +nix flake update +sudo nixos-rebuild switch --flake .#template +``` + +--- + +## Nach der Installation: Erste Schritte + +### 1. Grundeinstellungen + +Öffne **COSMIC Settings** (cosmic-settings): +- Zeitzone prüfen +- Tastaturlayout einstellen +- Bildschirmauflösung anpassen +- Netzwerk verbinden + +### 2. Terminal konfigurieren + +```bash +cosmic-terminal +# Rechtsklick → Preferences +``` + +### 3. Steam installieren (für Gaming) + +```bash +# Bereits in modules/gaming.nix eingebunden +# Überprüfe mit: +which steam + +# Oder starten: +steam +``` + +### 4. Zusätzliche Tools installieren (Optional) + +Falls du weitere Anwendungen brauchst, edit `modules/packages.nix`: + +```bash +nano ~/nixos-config/modules/packages.nix +``` + +Beispiele zum Hinzufügen: +```nix +environment.systemPackages = with pkgs; [ + firefox # Browser + vlc # Media Player + vscode # Editor +]; +``` + +Dann rebuild: +```bash +sudo nixos-rebuild switch --flake .#template +``` + +--- + +## Zurück zu KDE (Falls es nicht passt) + +Falls COSMIC nicht für dich funktioniert, einfach zurück: + +```bash +# configuration.nix +desktopConfig = ./modules/desktop/kde.nix; + +# Dann: +sudo nixos-rebuild switch --flake .#template +``` + +--- + +## Häufige Fragen + +**F: Wird meine Festplatte gelöscht?** +A: Nein! `nixos-rebuild switch` ist nicht-destruktiv. Alte Konfigurationen bleiben auf der Festplatte. + +**F: Wie lange dauert der Umbau?** +A: 5-30 Minuten. Hängt ab von: Internet, CPU, HDD/SSD, Cachegröße. + +**F: Kann ich zwischendurch abbrechen?** +A: ⚠️ Besser nicht. Wenn es hängt, lass es laufen oder force-kill mit `Ctrl+C` und retry. + +**F: Kann ich rollback machen?** +A: Ja! Boot-Menü zeigt alte Generationen. `systemctl revert` bei Fehler. + +--- + +## Erfolgreiche Installation ✅ + +Wenn alles funktioniert: +- COSMIC startet +- Alle Tools laden +- Steam funktioniert (wenn installiert) +- Internet läuft + +**Glückwunsch! Du bist auf COSMIC umgestiegen.** 🚀 + +--- + +## Notizen + +- **NixOS 26.05** → vollständig kompatibel ✅ +- **COSMIC** → Wayland-native, moderne Alternative +- **Chaotic Nyx** → Liefert aktuelle GPU-Treiber +- **Dein Gaming-Setup** → Behält alle Spiele-Features + +Viel Erfolg! 🎮 diff --git a/docs/GAMING_CUSTOMIZATION_GUIDE.md b/docs/GAMING_CUSTOMIZATION_GUIDE.md new file mode 100644 index 0000000..fe7503e --- /dev/null +++ b/docs/GAMING_CUSTOMIZATION_GUIDE.md @@ -0,0 +1,507 @@ +# Gaming & Customization Guide + +Anleitung für Gaming-Setup und Customization mit diesem NixOS-Template. + +--- + +## Gaming Setup + +### Steam & Gaming aktiv machen + +Dieses Template kommt mit Gaming-Support. Zum Aktivieren: + +**1. Configuration anpassen:** + +```nix +# In deiner configuration.nix sicherstellen, dass gaming.nix importiert ist: +imports = [ + ./modules/gaming.nix # ✅ sollte schon da sein +]; +``` + +**2. Rebuild:** + +```bash +sudo nixos-rebuild switch --flake .#template +``` + +### Proton & Steam + +Steam ist automatisch installiert. Für beste Kompatibilität: + +1. **Steam öffnen:** +```bash +steam +``` + +2. **Proton wählen (Built-in):** + - Settings → Compatibility + - "Use Steam Play for other titles" ✅ + - Version: **Proton (Experimental)** (neueste & beste) + +3. **Proton-GE installieren (Optional, aber empfohlen!):** + +Proton-GE hat bessere Kompatibilität & Performance als Standard Proton. + +**Schnelle Installation (Auto-Script):** +```bash +cd ~/nixos-config +chmod +x install-proton-ge.sh +./install-proton-ge.sh +# Steam neu starten +# Settings → Compatibility → "Proton-GE-X.X" wählen +``` + +**oder Manuell:** +```bash +# 1. Download Proton-GE +# https://github.com/GloriousEggroll/proton-ge-custom/releases + +# 2. Lade die neuste Version herunter (z.B. Proton-GE-9.xx.tar.gz) + +# 3. Extrahiere in Steam Compatibility Tools: +mkdir -p ~/.steam/root/compatibilitytools.d +cd ~/.steam/root/compatibilitytools.d +tar -xzf ~/Downloads/Proton-GE-9.xx.tar.gz + +# 4. Steam neu starten +steam + +# 5. In Steam: Settings → Compatibility → "Proton-GE-9.xx" wählen +``` + +4. **Proton-CachyOS (Alternative zu Proton-GE):** + +**Auto-Installation:** +```bash +cd ~/nixos-config +chmod +x install-proton-cachyos.sh +./install-proton-cachyos.sh +``` + +**oder Manuell:** Selbe Schritte wie Proton-GE, aber von: +https://github.com/CachyOS/proton-cachyos/releases + +5. **Performance-Tools:** +```bash +# MangoHUD (FPS-Counter) in Launch Options: +mangohud %command% + +# GameMode (Auto-Optimierung): +gamemoderun %command% + +# Beides zusammen: +gamemoderun mangohud %command% +``` + +6. **Welches Proton verwenden?** + +| Proton | Kompatibilität | Performance | Empfehlung | +|--------|---|---|---| +| Standard | ✅ Gut | ✅ Gut | OK | +| **Proton-GE** | **✅✅ Sehr gut** | **✅✅ Sehr gut** | **🏆 Empfohlen** | +| Proton-CachyOS | ✅✅ Sehr gut | ✅✅ Sehr gut | 🏆 Alternative | +| Proton Experimental | ✅ Gut | ✅ Gut | Fallback | + +**Hinweis:** Proton-GE & Proton-CachyOS sind Community-Builds, nicht in nixpkgs. Daher die Auto-Scripts! + +### GPU-Auswahl + +Das Template unterstützt mehrere Grafikkarten. Wähle eine: + +**In `configuration.nix`:** + +```nix +# AMD (Standard & empfohlen für Linux Gaming): +graphicsConfig = ./modules/graphics/mesa-amd.nix; + +# AMD mit OpenCL: +graphicsConfig = ./modules/graphics/mesa-amd-opencl.nix; + +# NVIDIA (Proprietäre Treiber): +graphicsConfig = ./modules/graphics/nvidia.nix; + +# NVIDIA Open-Source: +graphicsConfig = ./modules/graphics/nvidia-open.nix; +``` + +**Danach Rebuild:** +```bash +sudo nixos-rebuild switch --flake .#template +``` + +### Gaming-Performance Check + +```bash +# GameMode Status: +gamemode status + +# GPU-Infos: +glxinfo | grep "OpenGL" +lspci | grep VGA + +# Performance-Test: +glmark2 +``` + +### Wine & Proton + +Für non-Steam Spiele (GOG, itch.io): + +**Installiert über `modules/gaming/wine-proton.nix`:** + +```bash +# Wine eingebaut +protontricks + +# Beispiel: DXVK-Game starten +wine game.exe +``` + +--- + +## Desktop Auswahl & Customization + +### Desktop Environment wählen + +Das Template kommt mit mehreren DEs. Wähle deine: + +**In `configuration.nix`:** + +```nix +# KDE Plasma (Empfohlen für Balance): +desktopConfig = ./modules/desktop/kde.nix; + +# GNOME (Minimal, modern): +desktopConfig = ./modules/desktop/gnome.nix; + +# Budgie (Zwischen KDE & GNOME): +desktopConfig = ./modules/desktop/budgie.nix; + +# Hyprland (Tiling WM, Advanced): +desktopConfig = ./modules/desktop/hyprland.nix; + +# COSMIC (Modern, Wayland-native): +desktopConfig = ./modules/desktop/cosmic-max.nix; +``` + +**Rebuild:** +```bash +sudo nixos-rebuild switch --flake .#template +``` + +### KDE Plasma Customization + +**Themes & Appearance:** +1. System Settings → Appearance +2. Wähle: Global Theme, Color Scheme, Icons, Fonts + +**Panel anpassen:** +- Rechtsklick auf Panel → Edit Panel +- Widgets hinzufügen/entfernen +- Position/Größe ändern + +**Shortcuts:** +1. System Settings → Shortcuts & Gestures → Shortcuts +2. Neue Shortcuts hinzufügen + +**Tipps:** +```bash +# KDE-Themes aus Online-Store: +# Settings → Appearance → Global Theme → "Get New Global Themes" +``` + +### Hyprland Customization + +**Konfiguration Edit:** +```bash +nano ~/.config/hypr/hyprland.conf +``` + +**Basis-Setup:** +```conf +# Monitor +monitor = HDMI-1,1920x1080@60,0x0,1 + +# Keybinds +bind = $mainMod, Return, exec, kitty +bind = $mainMod, Q, killactive + +# Windows +general { + gaps_in = 5 + gaps_out = 10 +} +``` + +**Nach Änderung:** +```bash +# Hyprland neustart (ohne Neuboot) +Ctrl+Alt+Q +``` + +### COSMIC Customization + +**Desktop-Themes:** +1. Settings → Appearance +2. Theme/Color wählen +3. Accent Color anpassen + +**Shortcuts (neue):** +1. Settings → Keyboard → Shortcuts +2. "+" klicken +3. Command & Hotkey definieren + +--- + +## Allgemeine Customization + +### Packages hinzufügen + +Benutzerdefinierte Pakete in `modules/packages.nix`: + +```nix +environment.systemPackages = with pkgs; [ + firefox # Browser + neofetch # System Info + htop # Task Manager + ripgrep # Fast Search + bat # Better cat +]; +``` + +**Rebuild:** +```bash +sudo nixos-rebuild switch --flake .#template +``` + +### Audio anpassen + +**PipeWire (Standard):** +```bash +# Audio-Ausgabe wechseln: +pavucontrol + +# Oder Kommandozeile: +pactl list short sinks +pactl set-default-sink [SINK] +``` + +### Shell anpassen + +**Fish Shell aktivieren:** + +```nix +# In configuration.nix: +users.users.${userName}.shell = pkgs.fish; +``` + +**Fish Config** (`~/.config/fish/config.fish`): +```fish +# Aliases +alias ls="exa --icons" +alias cat="bat" +alias grep="ripgrep" + +# Prompt anpassen +function fish_prompt + echo (pwd) "> " +end +``` + +### Terminal-Customization + +**Hyprland Terminal (Kitty):** +```bash +nano ~/.config/kitty/kitty.conf +``` + +```ini +font_family Monospace +font_size 12 +background #1e1e1e +foreground #e0e0e0 +``` + +**KDE Terminal (Konsole):** +- Rechtsklick → Settings → Appearance +- Theme, Font, Color-Scheme wählen + +--- + +## Gaming-Tipps + +### FPS & Performance + +**In-Game FPS anzeigen:** +```bash +# MangoHUD (alle Spiele): +mangohud %command% + +# Steam Launch Options: +MANGOHUD=1 %command% +``` + +**CPU/GPU Monitoring:** +```bash +# Live Monitoring: +watch -n1 "nvidia-smi" # NVIDIA +watch -n1 "rocm-smi" # AMD +``` + +### Shader Cache + +```bash +# Cache Location: +~/.cache/nvidia-smi # NVIDIA +/tmp/mesa_shader_cache # Mesa/AMD + +# Cache Clear (bei Performance-Problemen): +rm -rf ~/.cache/nvidia-smi +``` + +### Proton Experimental + +Beste Kompatibilität, aber weniger stabil: + +1. Steam → Settings → Compatibility +2. "Use Steam Play for other titles" ✅ +3. Wähle: "Proton (Experimental)" oder "Proton-GE-Latest" + +### Spiele-Verzeichnis (Optional) + +Separate HDD/SSD für Spiele: + +```nix +# In configuration.nix: +environment.variables.STEAM_DIR = "/mnt/games/steam"; +``` + +--- + +## Troubleshooting + +### Steam startet nicht + +```bash +# Fresh Steam Start: +rm -rf ~/.steam ~/.steampath +steam + +# Oder Debug: +steam -console +``` + +### Spiel crasht sofort + +1. Unterschiedliche Proton-Version probieren +2. Kompatibilität-Verzeichnis löschen: +```bash +rm -rf ~/.steam/steamapps/compatdata/[GAME_ID]/ +``` +3. GPU-Treiber updaten: +```bash +nix flake update +sudo nixos-rebuild switch --flake .#template +``` + +### Black Screen bei Hyprland + NVIDIA + +```bash +# NVIDIA mit Hyprland braucht Special Config +# Siehe: ~/.config/hypr/hyprland.conf + +env = LIBVA_DRIVER_NAME,nvidia +env = XDG_SESSION_TYPE,wayland +``` + +### Desktop lädt nicht + +Fallback zu KDE: +```bash +# Edit configuration.nix: +desktopConfig = ./modules/desktop/kde.nix; + +# Terminal (Ctrl+Alt+F2): +sudo nixos-rebuild switch --flake .#template +``` + +--- + +## Performance-Tipps + +### Vor Gaming-Session + +```bash +# 1. Cleanup +sudo nix-collect-garbage + +# 2. Thermale Kühlung prüfen +sensors + +# 3. GameMode starten +gamemode + +# 4. Prozesse minimieren +killall firefox # oder andere Hintergrund-Apps +``` + +### Nvidia-spezifisch + +```bash +# Driver-Info: +nvidia-smi + +# Power Limit erhöhen: +nvidia-smi -pm 1 +nvidia-smi -pl [WATTAGE] +``` + +### AMD-spezifisch + +```bash +# GPU Info: +rocm-smi + +# Übertaktung (variabler): +# Nutze CoreCtrl GUI +``` + +--- + +## Nützliche Links + +- [NixOS Manual](https://nixos.org/manual/) +- [ProtonDB](https://protondb.com/) - Spiel-Kompatibilität checken +- [WineHQ](https://www.winehq.org/) - Wine/Proton Docs +- [Chaotic-Nyx](https://github.com/chaotic-cx/nyx) - Aktuelle Treiber + +--- + +## Tips für Freunde (Kopiervorlage) + +Falls Freunde dein Template nutzen: + +1. **Clone:** +```bash +git clone mein-nixos +cd mein-nixos +``` + +2. **Anpassen:** +- `hostName` in configuration.nix +- `userName` ändern +- `desktopConfig` & `graphicsConfig` wählen + +3. **Build:** +```bash +sudo nixos-rebuild switch --flake .#template +``` + +4. **Docs lesen:** +- [`COSMIC_SETUP_ANLEITUNG.md`](COSMIC_SETUP_ANLEITUNG.md) (falls COSMIC) +- Dieses Guide (Gaming & Customization) + +--- + +**Viel Erfolg beim Customizen! 🚀** diff --git a/docs/KERNEL_GAMING_TWEAKS.md b/docs/KERNEL_GAMING_TWEAKS.md new file mode 100644 index 0000000..3407af1 --- /dev/null +++ b/docs/KERNEL_GAMING_TWEAKS.md @@ -0,0 +1,171 @@ +# Kernel Auswahl & Gaming-Tweaks + +Dieses Repo nutzt eine sichtbare Kernel-Auswahl in `configuration.nix`. Der aktuell aktive Standard ist CachyOS: + +```nix +kernelConfig = ./modules/kernel/linux-cachyos.nix; +``` + +Wenn du nichts änderst, nutzt dein System also den CachyOS-Kernel plus die Basis-Tweaks aus `modules/base.nix`. + +--- + +## Empfehlung + +| Situation | Empfehlung | +|-----------|------------| +| Gaming-PC mit AMD oder NVIDIA | `linux-cachyos.nix` | +| Möglichst stabiler Gaming-Desktop | `linux-zen.nix` | +| Probleme mit Spezial-Kerneln | `linux-default.nix` | +| Security wichtiger als FPS | `linux-hardened.nix` | +| Experimentieren und Risiko okay | `linux-xanmod.nix` | + +Kurz gesagt: Starte mit CachyOS. Wenn es Probleme gibt, nimm Zen. Wenn es immer noch Probleme gibt, nimm Default. + +--- + +## Kernel wechseln + +Ändere in `configuration.nix` genau diese Zeile: + +```nix +kernelConfig = ./modules/kernel/linux-cachyos.nix; +``` + +Mögliche Werte: + +- `./modules/kernel/linux-default.nix` +- `./modules/kernel/linux-zen.nix` +- `./modules/kernel/linux-hardened.nix` +- `./modules/kernel/linux-cachyos.nix` +- `./modules/kernel/linux-xanmod.nix` + +Danach neu bauen: + +```bash +sudo nixos-rebuild switch --flake .#template +sudo reboot +``` + +Nach dem Neustart prüfen: + +```bash +uname -r +``` + +--- + +## Kernel-Vergleich + +### CachyOS + +Datei: `modules/kernel/linux-cachyos.nix` + +- Beste Standardwahl in diesem Repo +- Gaming- und Desktop-orientiert +- Nutzt das Chaotic-Nyx-Ökosystem +- Gute Wahl für aktuelle AMD- und NVIDIA-Gaming-Systeme + +### Linux Zen + +Datei: `modules/kernel/linux-zen.nix` + +- Sehr gute Desktop-Responsiveness +- Meist konservativer als CachyOS oder Xanmod +- Gute Alternative, wenn CachyOS auf einem System nicht sauber läuft + +### Linux Default + +Datei: `modules/kernel/linux-default.nix` + +- Stabiler Standard-Kernel aus nixpkgs +- Gute Fallback-Wahl bei Treiber- oder Build-Problemen +- Weniger auf Gaming-Latenz optimiert + +### Linux Hardened + +Datei: `modules/kernel/linux-hardened.nix` + +- Mehr Security-Hardening +- Kann Performance kosten +- Für Gaming normalerweise nicht die beste Wahl + +### Linux Xanmod + +Datei: `modules/kernel/linux-xanmod.nix` + +- Aggressive Performance-Ausrichtung +- Eher für Enthusiasten und Tests +- Wenn Stabilität wichtiger ist, bleib bei CachyOS oder Zen + +--- + +## Was ist in `base.nix`? + +`modules/base.nix` enthält die allgemeinen System- und Gaming-Basics, aber nicht mehr die Kernel-Auswahl selbst. + +Aktiv sind dort unter anderem: + +- `fs.inotify.max_user_watches` für Launcher, Shader-Caches und große Libraries +- `vm.max_map_count` für moderne Spiele und Proton +- größere Netzwerk-Buffer für Online-Spiele +- erhöhte File Descriptors für Steam, Lutris und ähnliche Tools +- CPU-Governor `performance` als Default +- Firmware, Microcode, Polkit, rtkit und Nix-GC + +Die Kernel-Entscheidung bleibt dadurch an einer Stelle: `kernelConfig` in `configuration.nix`. + +--- + +## Extra-Gaming-Tweaks + +Zusätzliche Tweaks werden in `configuration.nix` über einen Boolean geschaltet: + +```nix +enableExtraGamingTweaks = true; +``` + +Das Modul ist aktuell aktiviert und setzt nur zusätzliche, eher experimentelle Parameter wie: + +```nix +"idle=nomwait" +``` + +Wenn du möglichst konservativ bleiben willst, setze den Wert auf `false`. Die wichtigsten Gaming-Basics bleiben trotzdem über `modules/base.nix` aktiv. + +--- + +## Vorsicht bei `mitigations=off` + +In `modules/gaming-tweaks.nix` ist `mitigations=off` bewusst nur als Kommentar dokumentiert. + +Das kann in manchen Workloads Performance bringen, deaktiviert aber Schutzmechanismen gegen CPU-Sicherheitslücken. Für einen normalen Online-Gaming-Desktop ist das nicht empfehlenswert. + +--- + +## Troubleshooting + +Wenn der Kernel nicht baut: + +```nix +kernelConfig = ./modules/kernel/linux-zen.nix; +``` + +Wenn das System danach immer noch Probleme macht: + +```nix +kernelConfig = ./modules/kernel/linux-default.nix; +``` + +Wenn der Stromverbrauch zu hoch ist: + +```nix +powerManagement.cpuFreqGovernor = lib.mkForce "schedutil"; +``` + +Danach jeweils: + +```bash +sudo nixos-rebuild switch --flake .#template +sudo reboot +``` diff --git a/docs/MESA_GIT_ANLEITUNG.md b/docs/MESA_GIT_ANLEITUNG.md new file mode 100644 index 0000000..b9c558f --- /dev/null +++ b/docs/MESA_GIT_ANLEITUNG.md @@ -0,0 +1,346 @@ +# Mesa-Git Anleitung + +Erklärung und Nutzung von Mesa-Git in diesem NixOS-Gaming-Setup. + +--- + +## Was ist Mesa-Git? + +**Mesa** ist die Open-Source-Grafikbibliothek für Linux (OpenGL, Vulkan, etc.). + +**Mesa-Git** ist die **neueste Entwicklungsversion** von Mesa, die über **Chaotic-Nyx** bereitgestellt wird: +- Jeden Tag neue Commits aus dem Mesa-Repository +- Neueste GPU-Treiber-Optimierungen +- Neue Features für aktuelle Spiele +- **Warnung**: Manchmal instabil, kann Bugs haben + +--- + +## Warum ist Mesa-Git in dieser Config? + +Dieses Template fokussiert auf **Gaming mit modernen GPUs**. Mesa-Git bietet: + +✅ **Vorteile:** +- Bessere Performance in neuen Spielen +- Support für neuere GPUs +- Schnellere Fixes für GPU-Bugs +- Cutting-Edge Vulkan/OpenGL Features + +⚠️ **Nachteile:** +- Manchmal unstabil +- Kann seltene Crashes verursachen +- Weniger getestet als stabile Mesa-Versionen + +--- + +## Wie ist Mesa-Git konfiguriert? + +Die Aktivierung passiert in zwei Dateien: + +### 1. `flake.nix` – Chaotic-Nyx einbinden + +```nix +inputs = { + chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable"; +}; + +nixConfig = { + extra-substituters = [ + "https://nyx-cache.chaotic.cx/" + ]; + extra-trusted-public-keys = [ + "nyx-cache.chaotic.cx:dJxTrgMC3V3cFfyIiBQDQorG6k1LsqurH/srpMSq7qk=" + ]; +}; +``` + +**Was das macht:** +- Lädt Chaotic-Nyx als Input +- Nutzt Chaotic-Nyx Cache (schnellere Builds) +- Trusted key für Binär-Cache + +### 2. `modules/chaotic-nyx.nix` – Mesa-Git aktivieren + +```nix +{ pkgs, ... }: + +{ + nixpkgs.config.allowUnfree = true; + + chaotic = { + mesa-git = { + enable = true; + fallbackSpecialisation = true; + }; + }; + + environment.systemPackages = with pkgs; [ + mesa_git + ]; +} +``` + +**Was das macht:** +- `enable = true` – Aktiviert Mesa-Git +- `fallbackSpecialisation = true` – **Wichtig!** Falls Mesa-Git crasht, bootet automatisch auf stabile Mesa zurück +- `allowUnfree = true` – Erlaubt Pakete, die nicht frei sind (oft nötig für Gaming) +- `mesa_git` wird als Systempaket installiert + +--- + +## Mesa-Git ein/ausschalten + +### Mesa-Git aktivieren (Standard) + +Die Config ist bereits aktiviert. Falls du es deaktiviert hattest: + +**In `modules/chaotic-nyx.nix`:** +```nix +chaotic = { + mesa-git = { + enable = true; # ← Mesa-Git an + fallbackSpecialisation = true; + }; +}; +``` + +**Rebuild:** +```bash +sudo nixos-rebuild switch --flake .#template +``` + +### Mesa-Git deaktivieren (Fallback auf stabile Mesa) + +Wenn Mesa-Git Probleme macht: + +**In `modules/chaotic-nyx.nix`:** +```nix +chaotic = { + mesa-git = { + enable = false; # ← Mesa-Git aus + fallbackSpecialisation = true; + }; +}; +``` + +**Rebuild:** +```bash +sudo nixos-rebuild switch --flake .#template +``` + +--- + +## Fallback-Specialisation + +**Was ist das?** + +`fallbackSpecialisation = true` bedeutet: +- NixOS erstellt zwei Kernel-Boot-Optionen +- Option 1: **Deine aktuelle Config** (mit Mesa-Git) +- Option 2: **Fallback** (ohne Mesa-Git, stabile Mesa) + +**Wenn Mesa-Git crasht:** +1. Du siehst beim Boot das Grub-Menü +2. Wähle die Fallback-Specialisation (normalerweise unten) +3. System bootet mit stabiler Mesa + +**Danach:** +```bash +# Deaktiviere Mesa-Git in der Config +nano modules/chaotic-nyx.nix +# enable = false; +sudo nixos-rebuild switch --flake .#template +``` + +--- + +## Welche GPU braucht Mesa-Git? + +### ✅ AMD-GPUs (empfohlen für Mesa-Git) + +Mesa-Git funktioniert sehr gut mit: +- RDNA (RX 5000er, 6000er, 7000er) +- RDNA2 (RX 6000er) +- RDNA3 (RX 7000er) + +**Empfehlung:** `mesa-amd.nix` + `mesa-git.enable = true` = perfekt für AMD Gaming + +### ⚠️ Intel iGPU + +Mesa-Git unterstützt Intel-GPUs, kann aber: +- Manchmal unstabil sein +- Performance-Probleme haben +- Nicht empfohlen für Gaming + +### ❌ NVIDIA-GPUs + +**NVIDIA nutzt NICHT Mesa!** NVIDIA nutzt proprietäre Treiber: +- `nvidia.nix` – proprietäre Treiber (unabhängig von Mesa) +- `nvidia-open.nix` – Open-Source Treiber (auch nicht Mesa) + +Mesa-Git ist bei NVIDIA irrelevant. + +--- + +## Performance-Unterschiede + +### Mit Mesa-Git + +```bash +# Glmark2 Score (höher = besser): +# RX 6700 XT: ~3500 (mit Mesa-Git) +``` + +**Vorteile:** +- 5-15% bessere Performance in neuen Spielen +- Support für neuere Spiele-Features +- Bessere Vulkan-Optimierungen + +### Ohne Mesa-Git (stabile Mesa) + +```bash +# Glmark2 Score: +# RX 6700 XT: ~3200 (ohne Mesa-Git) +``` + +**Vorteile:** +- Stabiler +- Weniger Crashes +- Langfristig unterstützt + +--- + +## Troubleshooting + +### Problem: System bootet nicht nach Mesa-Git Aktivierung + +**Lösung:** +1. Beim Boot Grub-Menü öffnen (normalerweise nicht sichtbar, mehrmals ESC drücken) +2. Wähle die Specialisation mit "fallback" oder älterem Kernel +3. Nach erfolgreicher Boot: +```bash +# Deaktiviere Mesa-Git +sudo nano /root/nixos-config/modules/chaotic-nyx.nix +# enable = false; +sudo nixos-rebuild switch --flake .#template +``` + +### Problem: Mesa-Git crasht in Spielen + +**Schritt 1: Fallback-Boot** +- Grub-Menü → Fallback-Specialisation wählen + +**Schritt 2: Deaktiviere Mesa-Git** +```bash +# In modules/chaotic-nyx.nix +enable = false; +sudo nixos-rebuild switch --flake .#template +``` + +**Schritt 3: Überprüfe GPU-Treiber** +```bash +glxinfo | grep "OpenGL version" +``` + +### Problem: Chaotic-Nyx Cache funktioniert nicht + +**Lösung:** +Flake neu bauen (ignoriert Cache): +```bash +cd ~/nixos-config +nix flake update +sudo nixos-rebuild switch --flake .#template --no-substitute +``` + +--- + +## Performance testen + +### Mit Mesa-Git testen + +Aktiviere Mesa-Git und teste die Performance: + +```bash +# Benchmark starten +glmark2 + +# Spiel-Test +steam # Starte ein 3D-Spiel +# In Steam Launch Options: mangohud %command% +# Schau dir die FPS an +``` + +### Vergleich: Mit/ohne Mesa-Git + +**Schritt 1: Mit Mesa-Git** +```bash +# modules/chaotic-nyx.nix: enable = true +sudo nixos-rebuild switch --flake .#template +glmark2 # Score notieren +``` + +**Schritt 2: Ohne Mesa-Git** +```bash +# modules/chaotic-nyx.nix: enable = false +sudo nixos-rebuild switch --flake .#template +glmark2 # Score notieren +``` + +**Vergleich:** Unterschied ~5-15% + +--- + +## Chaotic-Nyx Update-Frequenz + +Mesa-Git wird täglich aktualisiert: + +```bash +# Aktualisiere auf neueste Mesa-Git Version +nix flake update +sudo nixos-rebuild switch --flake .#template +``` + +**Häufigkeit:** +- Täglich neue Commits +- Wöchentlich getestet +- Monatlich "major releases" + +--- + +## Weitere Optionen in Chaotic-Nyx + +`modules/chaotic-nyx.nix` kann auch enthalten: + +```nix +chaotic = { + mesa-git = { + enable = true; + fallbackSpecialisation = true; + }; + + # Optional: Andere Chaotic-Pakete + # linux-hardened.enable = true; + # gamescope.enable = true; +}; +``` + +Mehr Infos: https://github.com/chaotic-cx/nyx + +--- + +## Empfehlung + +| Situation | Empfehlung | +|-----------|-----------| +| **Neue AMD-GPU + Gaming** | Mesa-Git aktivieren ✅ | +| **Alte/Legacy Hardware** | Mesa-Git deaktivieren | +| **NVIDIA** | Ignorieren (braucht nicht Mesa) | +| **Stabilität wichtiger als Perf** | Mesa-Git deaktivieren | +| **Cutting-Edge Gaming** | Mesa-Git aktivieren | +| **Production/Workstation** | Mesa-Git deaktivieren | + +--- + +**Kurz:** Mesa-Git = Neueste AMD-GPU-Treiber für Gaming. Gut für Gaming, fallback hilft bei Problemen. + +Alles klar? 🚀 diff --git a/docs/PODMAN_DISTROBOX.md b/docs/PODMAN_DISTROBOX.md new file mode 100644 index 0000000..2532c31 --- /dev/null +++ b/docs/PODMAN_DISTROBOX.md @@ -0,0 +1,376 @@ +# Podman & Distrobox - Container auf NixOS + +Anleitung zur Nutzung von Podman und Distrobox für Container-Workloads. + +--- + +## Was ist Podman? + +**Podman** = Daemonless Container Runtime (Docker-Ersatz) + +``` +Docker = Client-Server Architektur +Podman = Direkt auf deinem User-Account +``` + +**Vorteile:** +- ✅ Kein Root-Daemon nötig +- ✅ Sicherer (läuft als normaler User) +- ✅ Docker-kompatibel (`docker` CLI funktioniert) +- ✅ Leichter als Docker +- ✅ Perfekt für Einzelnutzer + +--- + +## Was ist Distrobox? + +**Distrobox** = Einfache Linux-Container (für Nicht-Gaming) + +``` +Podman = Low-Level Container-Runtime +Distrobox = High-Level Container Management +``` + +**Use Case:** +- Du brauchst Ubuntu-Pakete, aber nutzt NixOS +- Python/Node.js Development-Umgebung +- Spezielle Tools die nur in anderen Distros verfügbar sind +- Sandbox für unbekannte Software + +**Nicht für Gaming!** (GameMode/Steam brauchen Bare Metal) + +--- + +## Aktivieren + +### In `configuration.nix` einfügen + +```nix +imports = [ + ./modules/containers/podman-distrobox.nix +]; +``` + +### Rebuild + +```bash +sudo nixos-rebuild switch --flake .#template +``` + +--- + +## Podman Basics + +### Docker-Kompatibilität + +Nach Aktivierung funktioniert `docker`-CLI: + +```bash +# Diese Befehle funktionieren: +docker ps +docker run ubuntu:latest echo "Hello" +docker pull alpine +docker exec +docker build + +# Im Hintergrund: Podman +``` + +### Container als User starten + +```bash +# Kein sudo nötig! +podman run -it ubuntu:latest bash + +# Oder +docker run -it alpine:latest sh +``` + +--- + +## Distrobox Basics + +### Distrobox-Container erstellen + +```bash +# Ubuntu-Container +distrobox create --name ubuntu-dev --image ubuntu:latest + +# Alpine-Container +distrobox create --name alpine-work --image alpine:latest + +# Fedora-Container +distrobox create --name fedora --image fedora:latest +``` + +### Container betreten + +```bash +distrobox enter ubuntu-dev +# Du bist jetzt in: Ubuntu Bash + +apt update && apt install python3 +# Ubuntu-Pakete installieren + +exit +# Zurück zu NixOS +``` + +### Container auflisten + +```bash +distrobox list + +# Output: +# NAME | STATUS | IMAGE NAME +# ubuntu-dev | CREATED | ubuntu:latest +# alpine-work | EXITED | alpine:latest +``` + +### Container löschen + +```bash +distrobox rm ubuntu-dev +``` + +--- + +## Praktische Beispiele + +### Beispiel 1: Python Development mit Ubuntu Libs + +```bash +# Container erstellen +distrobox create --name python-dev --image ubuntu:latest + +# Betreten +distrobox enter python-dev + +# Ubuntu-Packages installieren +apt update && apt install -y python3-pip libpython3-dev +pip install numpy scipy pandas + +# Work machen +python3 script.py + +exit +``` + +### Beispiel 2: Node.js in Alpine + +```bash +distrobox create --name nodejs --image node:18-alpine + +distrobox enter nodejs + +npm install -g yarn pnpm +npm run dev + +exit +``` + +### Beispiel 3: Spezielle Tools (z.B. Ubuntu-Spezific) + +```bash +distrobox create --name ubuntu-tools --image ubuntu:latest + +distrobox enter ubuntu-tools + +# Ubuntu-spezifische Tools installieren +apt install -y snap # oder andere Ubuntu-only Tools + +exit +``` + +--- + +## Heim-Verzeichnis Zugriff + +Distrobox automatische Mounts: + +```bash +# Von NixOS: +echo "test" > ~/test.txt + +# Im Container: +distrobox enter ubuntu-dev +ls ~ # Zeigt ~/test.txt (selbes Verzeichnis!) +``` + +**Wichtig:** Dateien sind Heim-verzeichnis-übergreifend sichtbar! + +--- + +## Netzwerk im Container + +### Zugriff auf Host + +```bash +distrobox enter ubuntu-dev + +# Kann auf deinen Host zugreifen +curl http://localhost:8080 # Wenn Host-Service läuft +ping 8.8.8.8 # Internet funktioniert +``` + +### Container veröffentlichen + +```bash +# Container als Service: +docker run -d -p 8080:80 nginx + +# Dann von außen: +curl http://localhost:8080 +``` + +--- + +## Performance + +### Podman vs. Docker + +``` +Docker: 100% +Podman: 99-101% (kaum Unterschied) +``` + +Podman ist manchmal sogar schneller! + +### Distrobox Overhead + +``` +Native NixOS: 100% +Im Distrobox: 98-99% (minimal) +``` + +Distrobox ist fast keine Verlangsamung. + +--- + +## Tipps & Tricks + +### Persistent Storage + +```bash +# Container mit Volume +distrobox create --name work --image ubuntu:latest \ + --volume /home/user/projects:/mnt/projects + +distrobox enter work +ls /mnt/projects # Deine Projekte! +``` + +### Container-Shell in NixOS starten + +```bash +# Shortcut für häufig benutzte Container +alias ubuntu-dev="distrobox enter ubuntu-dev" + +ubuntu-dev # Schnell drin! +``` + +### Distrobox "Export" (Advanced) + +```bash +# Programm aus Container in Host-Desktop sichtbar machen +distrobox export --app APPNAME --bin /usr/bin/program +``` + +--- + +## Troubleshooting + +### Problem: "podman: command not found" + +```bash +# Überprüfe ob aktiviert: +grep -r "podman" /etc/nixos/configuration.nix + +# Falls nicht: Zu configuration.nix hinzufügen +imports = [ ./modules/containers/podman-distrobox.nix ]; + +sudo nixos-rebuild switch --flake .#template +``` + +### Problem: Container haben kein Internet + +```bash +# DNS prüfen +podman run alpine ping 8.8.8.8 + +# Fallback: DNS manuell setzen +podman run --dns=8.8.8.8 alpine ping 8.8.8.8 + +# Oder in Datei konfigurieren +~/.config/containers/containers.conf: +dns_servers = ["8.8.8.8", "1.1.1.1"] +``` + +### Problem: Docker alias funktioniert nicht + +```bash +# Überprüfe Podman-Docker Compat: +ls -la /run/podman/podman.sock + +# Falls nicht da: Neustart +systemctl --user restart podman + +# Oder in nix.conf: +environment.variables.DOCKER_HOST = "unix:///run/podman/podman.sock"; +``` + +### Problem: "Too many open files" + +```bash +# File descriptors erhöhen in gaming-tweaks.nix +# Oder manuell: +ulimit -n 524288 +``` + +--- + +## Für Freunde: Erklärung + +### Einfach + +``` +Podman = Docker für NixOS +Distrobox = Einfache Linux-Umgebung in Container + +Nutzen wenn: +- Du brauchst Ubuntu-Pakete +- Python/Node.js Environment +- Isolierte Software-Testing +``` + +### NICHT für Gaming! + +``` +❌ Spiele laufen nicht in Distrobox +❌ GameMode funktioniert nicht im Container +❌ GPU-Zugriff kompliziert + +✅ Nutze Bare Metal für Gaming +``` + +--- + +## Checkliste + +- [ ] Modul in `configuration.nix` importiert +- [ ] Rebuild durchgeführt +- [ ] `podman run alpine echo "test"` funktioniert +- [ ] `distrobox` Befehl verfügbar +- [ ] Container erstellt & betreten funktioniert + +--- + +## Weitere Ressourcen + +- Podman Docs: https://docs.podman.io/ +- Distrobox GitHub: https://github.com/89luca89/distrobox +- OCI Images: https://hub.docker.com/ (auch mit Podman nutzbar) + +--- + +**Podman ist dein neuer Docker-Ersatz auf NixOS!** 🐳→📦 diff --git a/docs/SETUP_FUER_FREUNDE.md b/docs/SETUP_FUER_FREUNDE.md new file mode 100644 index 0000000..c966be4 --- /dev/null +++ b/docs/SETUP_FUER_FREUNDE.md @@ -0,0 +1,446 @@ +# Für Freunde: Komplette Anleitung zum Repo nutzen + +Alles, was du und deine Freunde wissen müssen, um dieses Repo erfolgreich zu nutzen. + +--- + +## Das Repo beim Klonen - Was passiert? + +### Schritt 1: Repo klonen + +```bash +git clone ~/nixos-config +cd ~/nixos-config +``` + +**Was wird geklont?** +- ✅ `flake.nix` – Die Eingangsdatei +- ✅ `flake.lock` – Gepinnte Versionen für reproduzierbare Builds +- ✅ Alle Module im `modules/`-Verzeichnis +- ✅ `configuration.nix` – Basis-Config +- ✅ `hardware-configuration.nix` – Host-spezifische Beispiel-/Ausgangsdatei +- ✅ Alle `.md`-Dateien (Anleitungen) +- ✅ Git-History + +**Was musst du trotzdem prüfen?** +- `hardware-configuration.nix` muss zu deinem Rechner passen. +- Auf einem anderen PC solltest du sie durch die lokal generierte Datei aus `/etc/nixos/` ersetzen. + +### Schritt 2: Inputs prüfen oder aktualisieren + +Nach dem Klonen kannst du direkt mit den gepinnten Versionen bauen. Wenn du bewusst aktualisieren willst: + +```bash +cd ~/nixos-config +nix flake update +``` + +**Was das macht:** +- Lädt alle Inputs herunter (nixpkgs, chaotic-nyx) +- Aktualisiert `flake.lock` +- Speichert exakte Versionen aller Abhängigkeiten + +**Wichtig:** `flake.lock` ist nicht hardware-spezifisch. Sie pinnt nur die Versionen der Flake-Inputs. Hardware-spezifisch ist vor allem `hardware-configuration.nix`. + +--- + +## Warum `flake.lock` im Repo ist + +**Gut - das ist absichtlich!** + +### Ohne `flake.lock` + +``` +Problem: Jeder Build kann andere Versionen von nixpkgs und Chaotic-Nyx ziehen. +- Alice baut heute +- Bob baut in zwei Wochen +- Charlie baut nach einem größeren nixpkgs-Update +→ schwerer vergleichbare Fehler und weniger reproduzierbare Builds +``` + +### Mit `flake.lock` + +``` +Alle starten mit denselben Input-Versionen. +- weniger Überraschungen beim ersten Build +- Updates passieren bewusst mit `nix flake update` +- Änderungen an nixpkgs/chaotic lassen sich als Git-Diff sehen +``` + +--- + +## Stable vs Unstable - Was sollte im Repo sein? + +### Aktuelle Wahl: `nixos-unstable` ✅ (Richtig!) + +**flake.nix sagt:** +```nix +nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; +``` + +**Warum unstable für dieses Repo?** + +| Kriterium | Stable | Unstable | +|-----------|--------|----------| +| **Stabilität** | Hoch | Mittel (aber gut getestet) | +| **Aktuelle Treiber** | ⚠️ Verzögert | ✅ Täglich neu | +| **Gaming** | Funktioniert | **Optimal** | +| **Mesa-Git** | ❌ Nicht möglich | ✅ Ja | +| **Chaotic-Nyx** | ❌ Nicht kompatibel | ✅ Ja | +| **Steam/Proton** | Funktioniert | **Neuste Fixes** | + +**Conclusion:** `nixos-unstable` ist die richtige Wahl für Gaming + Chaotic-Nyx. + +### Stable braucht man NUR wenn... + +```nix +# Nur in speziellen Fällen: +# - Production/Server (nicht Gaming!) +# - Maximale Stabilität wichtiger als aktuelle Treiber +# - Ältere Hardware (bekommt keine neuen Features) + +# NICHT empfohlen für dieses Gaming-Template! +``` + +--- + +## Kompletter Setup-Prozess für Freunde + +### Phase 1: Vorbereitung (vor Clone) + +**1.1 Frische NixOS-Installation** + +Du/deine Freunde brauchen eine funktionierende NixOS-Installation: + +```bash +# Auf der Installations-CD +# Normaler NixOS-Installer durchlaufen +# Irgendeine Config aussuchen (wird überschrieben) +``` + +**1.2 Nach Installation: Reboot & Login** + +```bash +sudo reboot +# Login mit den Credentials vom Installer +``` + +### Phase 2: Repository Setup + +**2.1 Repo klonen** + +```bash +git clone ~/nixos-config +cd ~/nixos-config +``` + +**2.2 Hardware-Config hinzufügen** + +Die aktuelle Hardware-Config vom System kopieren: + +```bash +sudo cp /etc/nixos/hardware-configuration.nix ~/nixos-config/ +``` + +**2.3 Configuration anpassen** + +```bash +nano ~/nixos-config/configuration.nix +``` + +Ändere diese 3 Werte: + +```nix +hostName = "mein-gaming-pc"; # Computername +userName = "max"; # Benutzername +fullName = "Max Mustermann"; # Vollständiger Name +``` + +**2.4 Desktop & GPU wählen** + +```nix +desktopConfig = ./modules/desktop/kde.nix; # oder cosmic-max.nix, gnome.nix, etc. +graphicsConfig = ./modules/graphics/mesa-amd.nix; # oder nvidia.nix, etc. +``` + +### Phase 3: Flake vorbereiten + +**3.1 Cachix überprüfen (Beschleunigung!)** + +Dieses Repo nutzt bereits **Chaotic-Nyx Cachix** (vorkompilierte Pakete). + +Das bedeutet: +- ✅ Builds sind 4-6x schneller +- ✅ Statt 90 Min → nur 15-30 Min +- ✅ Automatisch aktiviert, kein Setup nötig + +**Mehr Infos:** Siehe [`CACHIX_ANLEITUNG.md`](CACHIX_ANLEITUNG.md) + +**3.2 Flake Inputs aktualisieren (optional)** + +```bash +cd ~/nixos-config +nix flake update +``` + +**Das macht:** +- Lädt alle Packages herunter +- Aktualisiert `flake.lock` +- Speichert exakte Versionen + +**Dauer:** meist wenige Minuten, je nach Internetverbindung. + +Für den ersten Build kannst du diesen Schritt überspringen und die Versionen aus dem Repo nutzen. + +### Phase 4: System bauen & starten + +**4.1 NixOS Rebuild** + +```bash +sudo nixos-rebuild switch --flake .#template +``` + +**Das macht:** +- Baut NixOS mit deiner Config +- Installiert alle Packages +- Aktiviert sofort (kein Reboot nötig für erste Konfiguration) + +**Dauer:** 10-60 Minuten (beim ersten Mal) + +**Mögliche Fehler:** +- "Network is unreachable" → Netzwerk prüfen +- "Insufficient disk space" → Zu wenig Platz auf /nix +- Irgendwas mit nixpkgs → `nix flake update` und retry + +**4.2 Reboot (optional aber empfohlen)** + +```bash +sudo reboot +``` + +Nach dem Reboot: +- Neuer Desktop startet +- Gaming-Stack ist installiert +- Alles ready! + +--- + +## Nach dem Setup: Erste Schritte + +### 1. System überprüfen + +```bash +# Desktop prüfen +echo $DESKTOP_SESSION + +# GPU prüfen +glxinfo | grep "OpenGL" + +# Mesa-Git aktiv? +glxinfo | grep "Mesa" + +# Gaming-Tools +which steam +which gamescope +which mangohud +``` + +### 2. Steam einrichten + +```bash +steam +# Größe/Auflösung anpassen +# Account einloggen +# Controller Settings prüfen +``` + +### 3. Erstes Spiel testen + +```bash +# In Steam: Ein Spiel aus der Bibliothek starten +# (oder Proton-Spiel ausprobieren) +# Performance mit mangohud checken +``` + +--- + +## Mesa-Git für Freunde erklären + +### Einfache Erklärung: + +``` +Mesa-Git = Täglich neue GPU-Treiber für AMD + +Aktiviert in: modules/chaotic-nyx.nix +- enable = true → aktiv (Standard) +- enable = false → deaktiviert + +Wenn's crasht: Fallback bootet automatisch auf stabile Version +``` + +### Falls Freunde fragen: "Warum Mesa-Git?" + +Antworte: +- **AMD-Nutzer:** "Neueste Treiber = bessere Gaming-Performance" +- **NVIDIA-Nutzer:** "Ignorieren, ihr nutzt proprietäre Treiber" +- **Intel:** "Funktioniert, aber nicht optimiert für Gaming" + +### Falls Mesa-Git Probleme macht: + +```bash +# In modules/chaotic-nyx.nix: +enable = false; # Mesa-Git aus + +sudo nixos-rebuild switch --flake .#template +# System bootet auf stabile Mesa +``` + +--- + +## Häufige Probleme & Lösungen + +### Problem: `flake.lock` oder Flake-Inputs machen Probleme + +**Symptom:** +``` +nixpkgs/chaotic kann nicht geladen werden oder ein Input wirkt veraltet +``` + +**Lösung:** +```bash +# Stelle sicher, du bist im Repo-Verzeichnis +cd ~/nixos-config +nix flake update +``` + +### Problem: Kein Internet beim Build + +**Lösung:** +```bash +# Netzwerk testen +ping github.com + +# Falls offline: Später probieren +# Falls Online aber langsam: Geduld haben (kann 30+ min dauern) +``` + +### Problem: Eigene `flake.lock` von einem Fork? + +Wenn du aus einem Fork kommst und bewusst neu pinnen willst: +```bash +nix flake update +``` + +### Problem: "Chaotic-Nyx Cache nicht erreichbar" + +**Das ist normal!** Fallback auf lokales Bauen: +```bash +sudo nixos-rebuild switch --flake .#template --no-substitute +# Dauert länger, aber funktioniert +``` + +--- + +## Checkliste für Freunde + +**Vor Setup:** +- [ ] Frische NixOS-Installation +- [ ] Internet funktioniert +- [ ] Genug Platz auf Festplatte (~50 GB frei) + +**Beim Setup:** +- [ ] Repo geklont +- [ ] Hardware-Config kopiert +- [ ] configuration.nix angepasst +- [ ] Desktop & GPU gewählt +- [ ] `nix flake update` ausgeführt + +**Nach Setup:** +- [ ] Desktop startet +- [ ] Gaming-Tools erkannt (`which steam`) +- [ ] GPU erkannt (`glxinfo`) +- [ ] Erstes Spiel testet + +**Optional:** +- [ ] Steam Account einrichten +- [ ] Controller testen +- [ ] Performance benchmarken + +--- + +## Version-Management für Freunde + +### Warum `flake.lock` committen? + +```bash +# Immer committen, wenn du die System-Basis bewusst aktualisierst: +flake.lock +``` + +**Grund:** +``` +flake.lock = reproduzierbare Input-Versionen +- nixpkgs bleibt nachvollziehbar +- chaotic bleibt nachvollziehbar +- Updates lassen sich im Git-Diff reviewen + +→ Wenn etwas kaputtgeht, weißt du genauer, seit welchem Update. +``` + +### Richtig versionieren + +```bash +# ✅ Immer committen: +- flake.nix (Eingabe-Definition) +- flake.lock (Input-Versionen) +- configuration.nix (Config) +- modules/ (Die ganzen Module) +- *.md (Dokumentation) + +# ⚠️ Nur committen, wenn das Repo wirklich genau diesen Host beschreibt: +- hardware-configuration.nix +``` + +--- + +## Forks & Customization für Freunde + +### Falls Freunde das Repo forken wollen + +```bash +# 1. Fork machen +github.com/dein-name/nixos → Fork auf github.com/dein-name/nixos + +# 2. Clone forked version +git clone https://github.com/dein-name/nixos ~/nixos-config + +# 3. Anpassen +cd ~/nixos-config +# Alle Anpassungen durchführen + +# 4. Eigene changes committen +git add modules/packages.nix +git commit -m "Meine Pakete hinzugefügt" +git push + +# Falls Updates vom Original gewünscht: +git remote add upstream https://github.com/dein-name/nixos.git +git pull upstream main +``` + +--- + +## Zusammenfassung für Freunde + +| Frage | Antwort | +|-------|---------| +| **Brauche ich flake.lock?** | Ja, sie ist im Repo und pinnt die Input-Versionen | +| **Stable oder Unstable?** | `nixos-unstable` (für Gaming optimal) | +| **Mesa-Git automatisch?** | Ja, aktiviert in modules/chaotic-nyx.nix | +| **Kann ich den Desktop wechseln?** | Ja, einfach die Zeile in configuration.nix ändern | +| **Wie update ich später?** | `nix flake update && sudo nixos-rebuild switch --flake .#template` | +| **Kann ich meine Anpassungen speichern?** | Ja, in Unterordnern oder neuen Modulen | + +--- + +**Alles klar? Jetzt können deine Freunde direkt loslegen!** 🚀 diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..7dd9a94 --- /dev/null +++ b/flake.nix @@ -0,0 +1,31 @@ +{ + description = "Reusable NixOS gaming desktop template with selectable desktop and GPU modules"; + + nixConfig = { + extra-substituters = [ + "https://nyx-cache.chaotic.cx/" + ]; + extra-trusted-public-keys = [ + "nyx-cache.chaotic.cx:dJxTrgMC3V3cFfyIiBQDQorG6k1LsqurH/srpMSq7qk=" + ]; + }; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable"; + }; + + outputs = + { nixpkgs, chaotic, ... }: + { + nixosConfigurations = { + template = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + chaotic.nixosModules.default + ./configuration.nix + ]; + }; + }; + }; +} diff --git a/hardware-configuration.nix b/hardware-configuration.nix new file mode 100644 index 0000000..04bb2af --- /dev/null +++ b/hardware-configuration.nix @@ -0,0 +1,9 @@ +{ ... }: + +{ + # Diese Datei ist absichtlich nur ein Platzhalter fuer die Vorlage. + # Ersetze sie auf dem Zielsystem mit: + # sudo cp /etc/nixos/hardware-configuration.nix ./hardware-configuration.nix + # + # Ohne echte Hardware-Konfiguration wird ein produktiver Build nicht bootfaehig sein. +} diff --git a/install-proton-cachyos.sh b/install-proton-cachyos.sh new file mode 100755 index 0000000..6990bf1 --- /dev/null +++ b/install-proton-cachyos.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +# Proton-CachyOS Auto-Installer für NixOS + +set -e + +STEAM_COMPAT_DIR="$HOME/.steam/root/compatibilitytools.d" +mkdir -p "$STEAM_COMPAT_DIR" + +echo "🎮 Installing Proton-CachyOS..." + +# Hole neueste Proton-CachyOS Version +LATEST_RELEASE=$(curl -s https://api.github.com/repos/CachyOS/proton-cachyos/releases/latest \ + | grep -oP '"tag_name": "\K[^"]*' | head -1) + +if [ -z "$LATEST_RELEASE" ]; then + echo "❌ Fehler: Konnte Proton-CachyOS nicht finden" + exit 1 +fi + +DOWNLOAD_URL="https://github.com/CachyOS/proton-cachyos/releases/download/$LATEST_RELEASE/Proton-CachyOS-${LATEST_RELEASE}.tar.gz" + +echo "📥 Download: $LATEST_RELEASE" +cd "$STEAM_COMPAT_DIR" +wget -q --show-progress "$DOWNLOAD_URL" + +echo "📦 Extracting..." +tar -xzf "Proton-CachyOS-${LATEST_RELEASE}.tar.gz" +rm "Proton-CachyOS-${LATEST_RELEASE}.tar.gz" + +echo "✅ Proton-CachyOS $LATEST_RELEASE installiert!" +echo "🔄 Steam neu starten und Compatibility-Einstellung prüfen" diff --git a/install-proton-ge.sh b/install-proton-ge.sh new file mode 100755 index 0000000..9e07854 --- /dev/null +++ b/install-proton-ge.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +# Proton-GE Auto-Installer für NixOS + +set -e + +STEAM_COMPAT_DIR="$HOME/.steam/root/compatibilitytools.d" +mkdir -p "$STEAM_COMPAT_DIR" + +echo "🎮 Installing Proton-GE..." + +# Hole neueste Proton-GE Version +LATEST_RELEASE=$(curl -s https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest \ + | grep -oP '"tag_name": "\K[^"]*' | head -1) + +if [ -z "$LATEST_RELEASE" ]; then + echo "❌ Fehler: Konnte Proton-GE nicht finden" + exit 1 +fi + +DOWNLOAD_URL="https://github.com/GloriousEggroll/proton-ge-custom/releases/download/$LATEST_RELEASE/Proton-GE-${LATEST_RELEASE}.tar.gz" + +echo "📥 Download: $LATEST_RELEASE" +cd "$STEAM_COMPAT_DIR" +wget -q --show-progress "$DOWNLOAD_URL" + +echo "📦 Extracting..." +tar -xzf "Proton-GE-${LATEST_RELEASE}.tar.gz" +rm "Proton-GE-${LATEST_RELEASE}.tar.gz" + +echo "✅ Proton-GE $LATEST_RELEASE installiert!" +echo "🔄 Steam neu starten und Compatibility-Einstellung prüfen" diff --git a/modules/audio/pipewire.nix b/modules/audio/pipewire.nix new file mode 100644 index 0000000..972bf8a --- /dev/null +++ b/modules/audio/pipewire.nix @@ -0,0 +1,20 @@ +{ pkgs, ... }: + +{ + services.pulseaudio.enable = false; + + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; + }; + + environment.systemPackages = with pkgs; [ + easyeffects + helvum + pavucontrol + qpwgraph + ]; +} diff --git a/modules/base.nix b/modules/base.nix new file mode 100644 index 0000000..51fa00a --- /dev/null +++ b/modules/base.nix @@ -0,0 +1,79 @@ +{ config, lib, ... }: + +{ + boot = { + loader.systemd-boot.enable = true; + loader.efi.canTouchEfiVariables = true; + supportedFilesystems = [ "ntfs" ]; + + # Gaming-optimierte Kernel Parameter + kernel.sysctl = { + # Shader Cache & Game Launchers + "fs.inotify.max_user_watches" = 1048576; + "vm.max_map_count" = 2147483642; + + # Netzwerk-Performance für Online-Spiele + "net.core.rmem_max" = 134217728; + "net.core.wmem_max" = 134217728; + "net.ipv4.udp_mem" = "88560 118080 177120"; + "net.ipv4.tcp_tw_reuse" = 1; + "net.ipv4.ip_local_port_range" = "1024 65535"; + }; + + # Kernel-Parameter für bessere Responsiveness + kernelParams = [ + "sched_migration_cost_ns=5000000" # Weniger CPU-Migration + ]; + }; + + networking.networkmanager.enable = true; + + # Override these in configuration.nix if you need local defaults. + time.timeZone = lib.mkDefault "Europe/Berlin"; + + i18n.defaultLocale = lib.mkDefault "de_DE.UTF-8"; + console.keyMap = lib.mkDefault "de"; + + nix.settings = { + experimental-features = [ "nix-command" "flakes" ]; + auto-optimise-store = true; + }; + + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 7d"; + }; + + security = { + rtkit.enable = true; + polkit.enable = true; + }; + + hardware = { + enableRedistributableFirmware = true; + cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + }; + + services.fwupd.enable = true; + + # CPU im Performance-Mode für Gaming + powerManagement.cpuFreqGovernor = lib.mkDefault "performance"; + + # Erhöhe File Descriptors für Steam/Lutris + security.pam.loginLimits = [ + { + domain = "*"; + type = "soft"; + item = "nofile"; + value = "524288"; + } + { + domain = "*"; + type = "hard"; + item = "nofile"; + value = "524288"; + } + ]; +} diff --git a/modules/chaotic-nyx.nix b/modules/chaotic-nyx.nix new file mode 100644 index 0000000..9416909 --- /dev/null +++ b/modules/chaotic-nyx.nix @@ -0,0 +1,16 @@ +{ pkgs, ... }: + +{ + nixpkgs.config.allowUnfree = true; + + chaotic = { + mesa-git = { + enable = true; + fallbackSpecialisation = true; + }; + }; + + environment.systemPackages = with pkgs; [ + mesa_git + ]; +} diff --git a/modules/containers/podman-distrobox.nix b/modules/containers/podman-distrobox.nix new file mode 100644 index 0000000..4e6d164 --- /dev/null +++ b/modules/containers/podman-distrobox.nix @@ -0,0 +1,20 @@ +{ pkgs, ... }: + +{ + # Podman für Container + virtualisation.podman = { + enable = true; + dockerCompat = true; # docker CLI compatibility + defaultNetwork.settings.dns_enabled = true; + }; + + # Distrobox für einfache Linux-Container + environment.systemPackages = with pkgs; [ + distrobox + podman-compose + distroshelf + ]; + + # Benutzergruppe für Podman + users.groups.podman = {}; +} diff --git a/modules/desktop/budgie.nix b/modules/desktop/budgie.nix new file mode 100644 index 0000000..a15b532 --- /dev/null +++ b/modules/desktop/budgie.nix @@ -0,0 +1,6 @@ +{ ... }: + +{ + services.xserver.enable = true; + services.desktopManager.budgie.enable = true; +} diff --git a/modules/desktop/common.nix b/modules/desktop/common.nix new file mode 100644 index 0000000..fe04c50 --- /dev/null +++ b/modules/desktop/common.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ + seahorse + wayland-utils + wl-clipboard + ]; +} diff --git a/modules/desktop/cosmic-max.nix b/modules/desktop/cosmic-max.nix new file mode 100644 index 0000000..6239441 --- /dev/null +++ b/modules/desktop/cosmic-max.nix @@ -0,0 +1,39 @@ +{ pkgs, ... }: + +{ + services.desktopManager.cosmic = { + enable = true; + xwayland.enable = true; + }; + + services.displayManager.cosmic-greeter.enable = true; + xdg.portal.enable = true; + + environment.systemPackages = with pkgs; [ + # COSMIC essentials + gnome-keyring + seahorse + wayland-utils + wl-clipboard + xwayland + networkmanagerapplet + + # COSMIC tools + cosmic-term + cosmic-files + cosmic-settings + cosmic-randr + cosmic-launcher + cosmic-icons + cosmic-store + cosmic-applets + xdg-desktop-portal-cosmic + cosmic-ext-applet-minimon + cosmic-workspaces-epoch + + ]; + + environment.sessionVariables = { + COSMIC_DATA_CONTROL_ENABLED = "1"; + }; +} diff --git a/modules/desktop/cosmic.nix b/modules/desktop/cosmic.nix new file mode 100644 index 0000000..4a52fa3 --- /dev/null +++ b/modules/desktop/cosmic.nix @@ -0,0 +1,25 @@ +{ pkgs, ... }: + +{ + services.desktopManager.cosmic = { + enable = true; + xwayland.enable = true; + }; + + services.displayManager.cosmic-greeter.enable = true; + xdg.portal.enable = true; + + environment.systemPackages = with pkgs; [ + # Schlanke COSMIC-Basis fuer den Alltag + gnome-keyring + networkmanagerapplet + seahorse + wayland-utils + wl-clipboard + xwayland + ]; + + environment.sessionVariables = { + COSMIC_DATA_CONTROL_ENABLED = "1"; + }; +} diff --git a/modules/desktop/gnome.nix b/modules/desktop/gnome.nix new file mode 100644 index 0000000..3f898d2 --- /dev/null +++ b/modules/desktop/gnome.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: + +{ + services.xserver.enable = true; + services.displayManager.gdm.enable = true; + services.desktopManager.gnome.enable = true; + + environment.systemPackages = with pkgs; [ + gnome-tweaks + ]; +} diff --git a/modules/desktop/hyprland.nix b/modules/desktop/hyprland.nix new file mode 100644 index 0000000..068e3a9 --- /dev/null +++ b/modules/desktop/hyprland.nix @@ -0,0 +1,20 @@ +{ pkgs, ... }: + +{ + services.displayManager.sddm = { + enable = true; + wayland.enable = true; + }; + + programs.hyprland = { + enable = true; + withUWSM = true; + }; + + environment.systemPackages = with pkgs; [ + dunst + kitty + waybar + wofi + ]; +} diff --git a/modules/desktop/kde.nix b/modules/desktop/kde.nix new file mode 100644 index 0000000..a9b687a --- /dev/null +++ b/modules/desktop/kde.nix @@ -0,0 +1,12 @@ +{ ... }: + +{ + services.xserver.enable = true; + + services.displayManager.sddm = { + enable = true; + wayland.enable = true; + }; + + services.desktopManager.plasma6.enable = true; +} diff --git a/modules/flatpak.nix b/modules/flatpak.nix new file mode 100644 index 0000000..83ec361 --- /dev/null +++ b/modules/flatpak.nix @@ -0,0 +1,13 @@ +{ pkgs, ... }: + +{ + services.flatpak.enable = true; + + # Optional: Flatpak CLI auch direkt verfügbar machen + environment.systemPackages = with pkgs; [ + flatpak + ]; + + # XDG-Portale sind wichtig für Flatpak-Apps, File Picker, Screensharing etc. + xdg.portal.enable = true; +} diff --git a/modules/gaming-tweaks.nix b/modules/gaming-tweaks.nix new file mode 100644 index 0000000..c31bde1 --- /dev/null +++ b/modules/gaming-tweaks.nix @@ -0,0 +1,26 @@ +{ ... }: + +{ + # ACHTUNG: Diese Datei ist OPTIONAL! + # Die meisten Gaming-Tweaks sind bereits in modules/base.nix enthalten + # + # Diese Datei enthält nur ZUSÄTZLICHE, riskantere Optimierungen + # für extrem aggressive Gaming-Performance + + boot.kernelParams = [ + # ⚠️ WARNUNG: Deaktiviert Spectre/Meltdown-Mitigations! + # Sicherheitsrisiko, aber +20-30% Performance + # Nur für Offline-Gaming PCs empfohlen! + # "mitigations=off" + + # Stattdessen: Moderate zusätzliche Parameter + "idle=nomwait" # Bessere CPU-Idle-States + ]; + + # Optional: I/O Scheduler für Spiele (beste für Gaming) + # boot.kernelParams = [ "io_uring_enabled=1" ]; + + # CPU Scaling im Performance-Mode ist schon in base.nix aktiviert + # Falls du Powersaving brauchst, override in configuration.nix: + # powerManagement.cpuFreqGovernor = lib.mkForce "schedutil"; +} diff --git a/modules/gaming.nix b/modules/gaming.nix new file mode 100644 index 0000000..4877f7b --- /dev/null +++ b/modules/gaming.nix @@ -0,0 +1,33 @@ +{ pkgs, ... }: + +{ + imports = [ + ./gaming/wine-proton.nix + ]; + + programs = { + appimage = { + enable = true; + binfmt = true; + }; + gamemode.enable = true; + gamescope.enable = true; + steam = { + enable = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + localNetworkGameTransfers.openFirewall = true; + gamescopeSession.enable = true; + }; + }; + + environment.systemPackages = with pkgs; [ + ftb-app + gamemode + goverlay + heroic + lutris + mangohud + prismlauncher + ]; +} diff --git a/modules/gaming/wine-proton.nix b/modules/gaming/wine-proton.nix new file mode 100644 index 0000000..4ff0645 --- /dev/null +++ b/modules/gaming/wine-proton.nix @@ -0,0 +1,43 @@ +{ pkgs, ... }: + +{ + programs.steam.protontricks.enable = true; + + environment.systemPackages = with pkgs; [ + dxvk + protontricks + protonplus # Proton Updater GUI + steam-run + umu-launcher # Universal Launcher für nicht-Steam Spiele + vkd3d-proton + wineWow64Packages.stable + winetricks + ]; + + environment.sessionVariables = { + STEAM_EXTRA_COMPAT_TOOLS_PATHS = "$HOME/.steam/root/compatibilitytools.d"; + }; + + # ℹ️ PROTON-GE & PROTON-CACHYOS sind NICHT in nixpkgs! + # + # Warum nicht? + # - Community-Builds mit häufigen Updates (täglich/wöchentlich) + # - Nicht mainstream genug für nixpkgs + # - Standard-Proton (oben) ist in nixpkgs + # + # LÖSUNG 1: Automatisierte Installation (Empfohlen) + # $ chmod +x install-proton-ge.sh + # $ ./install-proton-ge.sh + # oder + # $ ./install-proton-cachyos.sh + # + # LÖSUNG 2: Manuell + # - https://github.com/GloriousEggroll/proton-ge-custom/releases + # - https://github.com/CachyOS/proton-cachyos/releases + # - In ~/.steam/root/compatibilitytools.d/ entpacken + # + # LÖSUNG 3: Chaotic-Nyx (bereits im Repo!) + # Chaotic-Nyx hat viele Gaming-Tools, aber nicht Proton-GE/CachyOS +} + + diff --git a/modules/graphics/mesa-amd-opencl.nix b/modules/graphics/mesa-amd-opencl.nix new file mode 100644 index 0000000..96c7ec3 --- /dev/null +++ b/modules/graphics/mesa-amd-opencl.nix @@ -0,0 +1,29 @@ +{ pkgs, ... }: + +{ + hardware.graphics = { + enable = true; + enable32Bit = true; + extraPackages = [ + pkgs.amdvlk + pkgs.rocmPackages.clr + pkgs.rocmPackages.clr.icd + ]; + extraPackages32 = [ + pkgs.driversi686Linux.amdvlk + ]; + }; + + services.xserver.videoDrivers = [ "amdgpu" ]; + + hardware.amdgpu = { + initrd.enable = true; + opencl.enable = true; + }; + + environment.systemPackages = with pkgs; [ + lact + mesa-demos + vulkan-tools + ]; +} diff --git a/modules/graphics/mesa-amd.nix b/modules/graphics/mesa-amd.nix new file mode 100644 index 0000000..a52e818 --- /dev/null +++ b/modules/graphics/mesa-amd.nix @@ -0,0 +1,20 @@ +{ pkgs, ... }: + +{ + hardware.graphics = { + enable = true; + enable32Bit = true; + }; + + hardware.amdgpu.initrd.enable = true; + + services.xserver.videoDrivers = [ "amdgpu" ]; + + services.lact.enable = true; + + environment.systemPackages = with pkgs; [ + lact + mesa-demos + vulkan-tools + ]; +} \ No newline at end of file diff --git a/modules/graphics/nvidia-open.nix b/modules/graphics/nvidia-open.nix new file mode 100644 index 0000000..5d05c2e --- /dev/null +++ b/modules/graphics/nvidia-open.nix @@ -0,0 +1,22 @@ +{ config, pkgs, ... }: + +{ + hardware.graphics = { + enable = true; + enable32Bit = true; + }; + + services.xserver.videoDrivers = [ "nvidia" ]; + + hardware.nvidia = { + modesetting.enable = true; + nvidiaSettings = true; + open = true; + package = config.boot.kernelPackages.nvidiaPackages.latest; + }; + + environment.systemPackages = with pkgs; [ + mesa-demos + vulkan-tools + ]; +} diff --git a/modules/graphics/nvidia.nix b/modules/graphics/nvidia.nix new file mode 100644 index 0000000..ce516f1 --- /dev/null +++ b/modules/graphics/nvidia.nix @@ -0,0 +1,22 @@ +{ config, pkgs, ... }: + +{ + hardware.graphics = { + enable = true; + enable32Bit = true; + }; + + services.xserver.videoDrivers = [ "nvidia" ]; + + hardware.nvidia = { + modesetting.enable = true; + nvidiaSettings = true; + open = false; + package = config.boot.kernelPackages.nvidiaPackages.latest; + }; + + environment.systemPackages = with pkgs; [ + mesa-demos + vulkan-tools + ]; +} diff --git a/modules/kernel/linux-cachyos.nix b/modules/kernel/linux-cachyos.nix new file mode 100644 index 0000000..d66f8d5 --- /dev/null +++ b/modules/kernel/linux-cachyos.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: + +{ + # Linux CachyOS Kernel (Gaming optimiert - EMPFOHLEN!) + # - Spezial-Kernel für Gaming & Desktop Performance + # - Bereits im base.nix aktiviert (das ist Standard) + # - CachyOS-Patchset mit BORE Scheduler + # - ~5-10% bessere Gaming-Performance als Zen + boot.kernelPackages = pkgs.linuxPackages_cachyos; +} diff --git a/modules/kernel/linux-default.nix b/modules/kernel/linux-default.nix new file mode 100644 index 0000000..9f39dd3 --- /dev/null +++ b/modules/kernel/linux-default.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: + +{ + # Standard Linux Kernel (stabil) + # - Empfohlen für Server & alte Hardware + # - Nicht für Gaming optimiert + boot.kernelPackages = pkgs.linuxPackages; +} diff --git a/modules/kernel/linux-hardened.nix b/modules/kernel/linux-hardened.nix new file mode 100644 index 0000000..c570e68 --- /dev/null +++ b/modules/kernel/linux-hardened.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: + +{ + # Linux Hardened Kernel (Sicherheit) + # - Zusätzliche Sicherheits-Patches + # - Speicherschutz, Exploit-Mitigation + # - Langsamer als Standard/Zen (Security > Performance) + boot.kernelPackages = pkgs.linuxPackages_hardened; +} diff --git a/modules/kernel/linux-xanmod.nix b/modules/kernel/linux-xanmod.nix new file mode 100644 index 0000000..9d1741e --- /dev/null +++ b/modules/kernel/linux-xanmod.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: + +{ + # Linux Xanmod Kernel (Extreme Performance) + # - Aggressive Performance-Optimierungen + # - Nicht immer stabil + # - Mehr Performance als CachyOS (aber riskanter) + # - Für Enthusiasten + boot.kernelPackages = pkgs.linuxPackages_xanmod; +} diff --git a/modules/kernel/linux-zen.nix b/modules/kernel/linux-zen.nix new file mode 100644 index 0000000..fab70de --- /dev/null +++ b/modules/kernel/linux-zen.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: + +{ + # Linux Zen Kernel (Gaming-optimiert) + # - Bessere Responsiveness + # - Optimiert für Desktop/Gaming Workloads + # - Schnellere Builds, kleinere Größe + boot.kernelPackages = pkgs.linuxPackages_zen; +} diff --git a/modules/packages.nix b/modules/packages.nix new file mode 100644 index 0000000..e848f97 --- /dev/null +++ b/modules/packages.nix @@ -0,0 +1,24 @@ +{ pkgs, ... }: + +{ + # Corsair Keyboard/Mouse Daemon + GUI + hardware.ckb-next.enable = true; + + # Eigene Zusatzpakete kommen hier rein. + environment.systemPackages = with pkgs; [ + discord + firefox + teamspeak6-client + vscodium + spotify + gearlever + git + protonplus + zapzap + bambustudio + + # GUI ist durch hardware.ckb-next.enable normalerweise schon dabei, + # kann aber drin bleiben, falls du sie explizit im Menü haben willst. + ckb-next + ]; +} \ No newline at end of file diff --git a/modules/peripherals.nix b/modules/peripherals.nix new file mode 100644 index 0000000..a966218 --- /dev/null +++ b/modules/peripherals.nix @@ -0,0 +1,21 @@ +{ pkgs, ... }: + +{ + hardware = { + i2c.enable = true; + steam-hardware.enable = true; + }; + + services = { + hardware.openrgb.enable = true; + ratbagd.enable = true; + }; + + environment.systemPackages = with pkgs; [ + openrgb + pciutils + piper + solaar + usbutils + ]; +}