updated
This commit is contained in:
@@ -10,6 +10,17 @@ Diese Basis-Config ist als wiederverwendbare Vorlage für ein NixOS-Gaming-Deskt
|
|||||||
- Basis für RGB- und Gaming-Peripherie
|
- Basis für RGB- und Gaming-Peripherie
|
||||||
- Desktop-Auswahl zwischen KDE, GNOME, Budgie, Hyprland und COSMIC
|
- Desktop-Auswahl zwischen KDE, GNOME, Budgie, Hyprland und COSMIC
|
||||||
|
|
||||||
|
## Dokumentation
|
||||||
|
|
||||||
|
- [SETUP_FUER_FREUNDE.md](docs/SETUP_FUER_FREUNDE.md): Einstieg und kompletter Setup-Prozess
|
||||||
|
- [CACHIX_ANLEITUNG.md](docs/CACHIX_ANLEITUNG.md): Cachix und schnellere Builds
|
||||||
|
- [GAMING_CUSTOMIZATION_GUIDE.md](docs/GAMING_CUSTOMIZATION_GUIDE.md): Gaming, Steam, Proton und Desktop-Anpassung
|
||||||
|
- [MESA_GIT_ANLEITUNG.md](docs/MESA_GIT_ANLEITUNG.md): Mesa-Git und GPU-Treiber
|
||||||
|
- [COSMIC_SETUP_ANLEITUNG.md](docs/COSMIC_SETUP_ANLEITUNG.md): COSMIC Desktop
|
||||||
|
- [KERNEL_GAMING_TWEAKS.md](docs/KERNEL_GAMING_TWEAKS.md): Kernel-Auswahl und Performance
|
||||||
|
- [PODMAN_DISTROBOX.md](docs/PODMAN_DISTROBOX.md): Podman und Distrobox
|
||||||
|
- [UPDATER_ANLEITUNG.md](docs/UPDATER_ANLEITUNG.md): `nixos-update`
|
||||||
|
|
||||||
## Struktur
|
## Struktur
|
||||||
|
|
||||||
- `flake.nix`: Einstieg über `nixos-unstable` + `chaotic-cx/nyx`
|
- `flake.nix`: Einstieg über `nixos-unstable` + `chaotic-cx/nyx`
|
||||||
@@ -75,7 +86,7 @@ fullName = "Euer Name"; # z.B. "Max Mustermann"
|
|||||||
```nix
|
```nix
|
||||||
desktopConfig = ./modules/desktop/kde.nix; # oder: cosmic-max.nix, gnome.nix, hyprland.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
|
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
|
kernelConfig = ./modules/kernel/linux-cachyos.nix; # oder: linux-zen.nix, linux-xanmod.nix, linux-default.nix
|
||||||
enableExtraGamingTweaks = true; # false für konservativere Defaults
|
enableExtraGamingTweaks = true; # false für konservativere Defaults
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -99,6 +110,7 @@ Das war's! Nach dem Neustart startet euer neues System.
|
|||||||
- **Gaming-Setup & Customization**: Siehe [`docs/GAMING_CUSTOMIZATION_GUIDE.md`](docs/GAMING_CUSTOMIZATION_GUIDE.md)
|
- **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)
|
- **Zu COSMIC wechseln**: Siehe [`docs/COSMIC_SETUP_ANLEITUNG.md`](docs/COSMIC_SETUP_ANLEITUNG.md)
|
||||||
- **Mehr Pakete installieren**: Edit `modules/packages.nix`
|
- **Mehr Pakete installieren**: Edit `modules/packages.nix`
|
||||||
|
- **Update-Befehl nutzen**: `nixos-update`, `nixos-update boot` oder `nixos-update update-inputs`
|
||||||
|
|
||||||
## Vorlage anpassen
|
## Vorlage anpassen
|
||||||
|
|
||||||
@@ -300,85 +312,6 @@ nix flake update
|
|||||||
sudo nixos-rebuild switch --flake .#template
|
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
|
## Späterer Ausbau
|
||||||
|
|
||||||
- Desktop-spezifische Pakete und Defaults weiter tunen, z. B. Autologin, Keyring-Policy, Flatpak
|
- Desktop-spezifische Pakete und Defaults weiter tunen, z. B. Autologin, Keyring-Policy, Flatpak
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ let
|
|||||||
# ./modules/kernel/linux-zen.nix (Gaming optimiert, empfohlen)
|
# ./modules/kernel/linux-zen.nix (Gaming optimiert, empfohlen)
|
||||||
# ./modules/kernel/linux-hardened.nix (Security, langsamer)
|
# ./modules/kernel/linux-hardened.nix (Security, langsamer)
|
||||||
# ./modules/kernel/linux-cachyos.nix
|
# ./modules/kernel/linux-cachyos.nix
|
||||||
|
# ./modules/kernel/linux-xanmod.nix (experimentell, aggressiver)
|
||||||
kernelConfig = ./modules/kernel/linux-cachyos.nix;
|
kernelConfig = ./modules/kernel/linux-cachyos.nix;
|
||||||
|
|
||||||
# Zusätzliche Gaming-Tweaks aktivieren/deaktivieren.
|
# Zusätzliche Gaming-Tweaks aktivieren/deaktivieren.
|
||||||
@@ -37,6 +38,7 @@ in
|
|||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./modules/base.nix
|
./modules/base.nix
|
||||||
./modules/packages.nix
|
./modules/packages.nix
|
||||||
|
./modules/updater.nix
|
||||||
./modules/audio/pipewire.nix
|
./modules/audio/pipewire.nix
|
||||||
./modules/chaotic-nyx.nix
|
./modules/chaotic-nyx.nix
|
||||||
graphicsConfig
|
graphicsConfig
|
||||||
|
|||||||
+13
-13
@@ -10,16 +10,16 @@ Wie du Cachix nutzt, um deine NixOS-Builds massiv zu beschleunigen.
|
|||||||
|
|
||||||
Statt alles selbst zu kompilieren:
|
Statt alles selbst zu kompilieren:
|
||||||
```
|
```
|
||||||
❌ Kompilieren (1-2 Stunden):
|
Kompilieren (1-2 Stunden):
|
||||||
gcc + glibc + steam + mesa + ... = sehr lange
|
gcc + glibc + steam + mesa + ... = sehr lange
|
||||||
|
|
||||||
✅ Mit Cachix (10-30 Min):
|
Mit Cachix (10-30 Min):
|
||||||
Download vorkompilierte Binaries = schnell!
|
Download vorkompilierte Binaries = schnell!
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Cachix bereits im Repo aktiviert! ✅
|
## Cachix bereits im Repo aktiviert!
|
||||||
|
|
||||||
Dieses Template nutzt bereits **Chaotic-Nyx Cachix**:
|
Dieses Template nutzt bereits **Chaotic-Nyx Cachix**:
|
||||||
|
|
||||||
@@ -36,9 +36,9 @@ nixConfig = {
|
|||||||
```
|
```
|
||||||
|
|
||||||
**Was das bedeutet:**
|
**Was das bedeutet:**
|
||||||
- ✅ `substituters` = Wo Binaries runterladen
|
- `substituters` = Wo Binaries runterladen
|
||||||
- ✅ `trusted-public-keys` = Sichere Signatur für Cache
|
- `trusted-public-keys` = Sichere Signatur für Cache
|
||||||
- ✅ Automatisch aktiviert, kein Setup nötig!
|
- Automatisch aktiviert, kein Setup nötig!
|
||||||
|
|
||||||
**Performance-Gewinn:**
|
**Performance-Gewinn:**
|
||||||
```
|
```
|
||||||
@@ -98,7 +98,7 @@ nixConfig = {
|
|||||||
|
|
||||||
Falls ihr später selbst Caches hinzufügen wollt:
|
Falls ihr später selbst Caches hinzufügen wollt:
|
||||||
|
|
||||||
### Methode 1: In `flake.nix` (für dieses Repo) ✅
|
### Methode 1: In `flake.nix` (für dieses Repo)
|
||||||
|
|
||||||
Wir nutzen das schon:
|
Wir nutzen das schon:
|
||||||
```nix
|
```nix
|
||||||
@@ -367,10 +367,10 @@ df -h /nix
|
|||||||
|
|
||||||
| Punkt | Status |
|
| Punkt | Status |
|
||||||
|-------|--------|
|
|-------|--------|
|
||||||
| **Cachix aktiv?** | ✅ Ja (Chaotic-Nyx) |
|
| **Cachix aktiv?** | Ja (Chaotic-Nyx) |
|
||||||
| **Automatisch?** | ✅ Ja, kein Setup nötig |
|
| **Automatisch?** | Ja, kein Setup nötig |
|
||||||
| **Performance-Gewinn** | ✅ 4-6x schneller |
|
| **Performance-Gewinn** | 4-6x schneller |
|
||||||
| **Sicher?** | ✅ Ja, signierte Pakete |
|
| **Sicher?** | Ja, signierte Pakete |
|
||||||
| **Für Freunde wichtig?** | ✅ Ja, erspart viel Build-Zeit |
|
| **Für Freunde wichtig?** | Ja, erspart viel Build-Zeit |
|
||||||
|
|
||||||
**Cachix ist schon aktiviert – einfach genießen!** 🚀
|
**Cachix ist schon aktiviert – einfach genießen!**
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ Anleitung zum Wechsel von deinem aktuellen NixOS 26.05 Setup zu COSMIC Desktop E
|
|||||||
|
|
||||||
## Voraussetzungen
|
## Voraussetzungen
|
||||||
|
|
||||||
- NixOS 26.05 installiert (✅ dein aktueller Stand)
|
- NixOS 26.05 installiert ( dein aktueller Stand)
|
||||||
- Zugriff auf Terminal/SSH
|
- Zugriff auf Terminal/SSH
|
||||||
- Die Dateien im `~/nixos-config` Verzeichnis
|
- Die Dateien im `~/nixos-config` Verzeichnis
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ Die `flake.nix` braucht keinen Umbau - sie hat schon alles für COSMIC:
|
|||||||
cat ~/nixos-config/flake.nix
|
cat ~/nixos-config/flake.nix
|
||||||
```
|
```
|
||||||
|
|
||||||
✅ Sollte enthalten:
|
Sollte enthalten:
|
||||||
- `chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable"` (für aktuelle Pakete)
|
- `chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable"` (für aktuelle Pakete)
|
||||||
- Extra Substituter für `nyx-cache.chaotic.cx`
|
- Extra Substituter für `nyx-cache.chaotic.cx`
|
||||||
|
|
||||||
@@ -265,14 +265,14 @@ A: Nein! `nixos-rebuild switch` ist nicht-destruktiv. Alte Konfigurationen bleib
|
|||||||
A: 5-30 Minuten. Hängt ab von: Internet, CPU, HDD/SSD, Cachegröße.
|
A: 5-30 Minuten. Hängt ab von: Internet, CPU, HDD/SSD, Cachegröße.
|
||||||
|
|
||||||
**F: Kann ich zwischendurch abbrechen?**
|
**F: Kann ich zwischendurch abbrechen?**
|
||||||
A: ⚠️ Besser nicht. Wenn es hängt, lass es laufen oder force-kill mit `Ctrl+C` und retry.
|
A: Besser nicht. Wenn es hängt, lass es laufen oder force-kill mit `Ctrl+C` und retry.
|
||||||
|
|
||||||
**F: Kann ich rollback machen?**
|
**F: Kann ich rollback machen?**
|
||||||
A: Ja! Boot-Menü zeigt alte Generationen. `systemctl revert` bei Fehler.
|
A: Ja! Boot-Menü zeigt alte Generationen. `systemctl revert` bei Fehler.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Erfolgreiche Installation ✅
|
## Erfolgreiche Installation
|
||||||
|
|
||||||
Wenn alles funktioniert:
|
Wenn alles funktioniert:
|
||||||
- COSMIC startet
|
- COSMIC startet
|
||||||
@@ -280,15 +280,15 @@ Wenn alles funktioniert:
|
|||||||
- Steam funktioniert (wenn installiert)
|
- Steam funktioniert (wenn installiert)
|
||||||
- Internet läuft
|
- Internet läuft
|
||||||
|
|
||||||
**Glückwunsch! Du bist auf COSMIC umgestiegen.** 🚀
|
**Glückwunsch! Du bist auf COSMIC umgestiegen.**
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Notizen
|
## Notizen
|
||||||
|
|
||||||
- **NixOS 26.05** → vollständig kompatibel ✅
|
- **NixOS 26.05** → vollständig kompatibel
|
||||||
- **COSMIC** → Wayland-native, moderne Alternative
|
- **COSMIC** → Wayland-native, moderne Alternative
|
||||||
- **Chaotic Nyx** → Liefert aktuelle GPU-Treiber
|
- **Chaotic Nyx** → Liefert aktuelle GPU-Treiber
|
||||||
- **Dein Gaming-Setup** → Behält alle Spiele-Features
|
- **Dein Gaming-Setup** → Behält alle Spiele-Features
|
||||||
|
|
||||||
Viel Erfolg! 🎮
|
Viel Erfolg!
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ Dieses Template kommt mit Gaming-Support. Zum Aktivieren:
|
|||||||
```nix
|
```nix
|
||||||
# In deiner configuration.nix sicherstellen, dass gaming.nix importiert ist:
|
# In deiner configuration.nix sicherstellen, dass gaming.nix importiert ist:
|
||||||
imports = [
|
imports = [
|
||||||
./modules/gaming.nix # ✅ sollte schon da sein
|
./modules/gaming.nix # sollte schon da sein
|
||||||
];
|
];
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ steam
|
|||||||
|
|
||||||
2. **Proton wählen (Built-in):**
|
2. **Proton wählen (Built-in):**
|
||||||
- Settings → Compatibility
|
- Settings → Compatibility
|
||||||
- "Use Steam Play for other titles" ✅
|
- "Use Steam Play for other titles"
|
||||||
- Version: **Proton (Experimental)** (neueste & beste)
|
- Version: **Proton (Experimental)** (neueste & beste)
|
||||||
|
|
||||||
3. **Proton-GE installieren (Optional, aber empfohlen!):**
|
3. **Proton-GE installieren (Optional, aber empfohlen!):**
|
||||||
@@ -98,10 +98,10 @@ gamemoderun mangohud %command%
|
|||||||
|
|
||||||
| Proton | Kompatibilität | Performance | Empfehlung |
|
| Proton | Kompatibilität | Performance | Empfehlung |
|
||||||
|--------|---|---|---|
|
|--------|---|---|---|
|
||||||
| Standard | ✅ Gut | ✅ Gut | OK |
|
| Standard | Gut | Gut | OK |
|
||||||
| **Proton-GE** | **✅✅ Sehr gut** | **✅✅ Sehr gut** | **🏆 Empfohlen** |
|
| **Proton-GE** | **Sehr gut** | **Sehr gut** | **Empfohlen** |
|
||||||
| Proton-CachyOS | ✅✅ Sehr gut | ✅✅ Sehr gut | 🏆 Alternative |
|
| Proton-CachyOS | Sehr gut | Sehr gut | Alternative |
|
||||||
| Proton Experimental | ✅ Gut | ✅ Gut | Fallback |
|
| Proton Experimental | Gut | Gut | Fallback |
|
||||||
|
|
||||||
**Hinweis:** Proton-GE & Proton-CachyOS sind Community-Builds, nicht in nixpkgs. Daher die Auto-Scripts!
|
**Hinweis:** Proton-GE & Proton-CachyOS sind Community-Builds, nicht in nixpkgs. Daher die Auto-Scripts!
|
||||||
|
|
||||||
@@ -365,7 +365,7 @@ rm -rf ~/.cache/nvidia-smi
|
|||||||
Beste Kompatibilität, aber weniger stabil:
|
Beste Kompatibilität, aber weniger stabil:
|
||||||
|
|
||||||
1. Steam → Settings → Compatibility
|
1. Steam → Settings → Compatibility
|
||||||
2. "Use Steam Play for other titles" ✅
|
2. "Use Steam Play for other titles"
|
||||||
3. Wähle: "Proton (Experimental)" oder "Proton-GE-Latest"
|
3. Wähle: "Proton (Experimental)" oder "Proton-GE-Latest"
|
||||||
|
|
||||||
### Spiele-Verzeichnis (Optional)
|
### Spiele-Verzeichnis (Optional)
|
||||||
@@ -504,4 +504,4 @@ sudo nixos-rebuild switch --flake .#template
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Viel Erfolg beim Customizen! 🚀**
|
**Viel Erfolg beim Customizen!**
|
||||||
|
|||||||
@@ -20,13 +20,13 @@ Erklärung und Nutzung von Mesa-Git in diesem NixOS-Gaming-Setup.
|
|||||||
|
|
||||||
Dieses Template fokussiert auf **Gaming mit modernen GPUs**. Mesa-Git bietet:
|
Dieses Template fokussiert auf **Gaming mit modernen GPUs**. Mesa-Git bietet:
|
||||||
|
|
||||||
✅ **Vorteile:**
|
**Vorteile:**
|
||||||
- Bessere Performance in neuen Spielen
|
- Bessere Performance in neuen Spielen
|
||||||
- Support für neuere GPUs
|
- Support für neuere GPUs
|
||||||
- Schnellere Fixes für GPU-Bugs
|
- Schnellere Fixes für GPU-Bugs
|
||||||
- Cutting-Edge Vulkan/OpenGL Features
|
- Cutting-Edge Vulkan/OpenGL Features
|
||||||
|
|
||||||
⚠️ **Nachteile:**
|
**Nachteile:**
|
||||||
- Manchmal unstabil
|
- Manchmal unstabil
|
||||||
- Kann seltene Crashes verursachen
|
- Kann seltene Crashes verursachen
|
||||||
- Weniger getestet als stabile Mesa-Versionen
|
- Weniger getestet als stabile Mesa-Versionen
|
||||||
@@ -156,7 +156,7 @@ sudo nixos-rebuild switch --flake .#template
|
|||||||
|
|
||||||
## Welche GPU braucht Mesa-Git?
|
## Welche GPU braucht Mesa-Git?
|
||||||
|
|
||||||
### ✅ AMD-GPUs (empfohlen für Mesa-Git)
|
### AMD-GPUs (empfohlen für Mesa-Git)
|
||||||
|
|
||||||
Mesa-Git funktioniert sehr gut mit:
|
Mesa-Git funktioniert sehr gut mit:
|
||||||
- RDNA (RX 5000er, 6000er, 7000er)
|
- RDNA (RX 5000er, 6000er, 7000er)
|
||||||
@@ -165,14 +165,14 @@ Mesa-Git funktioniert sehr gut mit:
|
|||||||
|
|
||||||
**Empfehlung:** `mesa-amd.nix` + `mesa-git.enable = true` = perfekt für AMD Gaming
|
**Empfehlung:** `mesa-amd.nix` + `mesa-git.enable = true` = perfekt für AMD Gaming
|
||||||
|
|
||||||
### ⚠️ Intel iGPU
|
### Intel iGPU
|
||||||
|
|
||||||
Mesa-Git unterstützt Intel-GPUs, kann aber:
|
Mesa-Git unterstützt Intel-GPUs, kann aber:
|
||||||
- Manchmal unstabil sein
|
- Manchmal unstabil sein
|
||||||
- Performance-Probleme haben
|
- Performance-Probleme haben
|
||||||
- Nicht empfohlen für Gaming
|
- Nicht empfohlen für Gaming
|
||||||
|
|
||||||
### ❌ NVIDIA-GPUs
|
### NVIDIA-GPUs
|
||||||
|
|
||||||
**NVIDIA nutzt NICHT Mesa!** NVIDIA nutzt proprietäre Treiber:
|
**NVIDIA nutzt NICHT Mesa!** NVIDIA nutzt proprietäre Treiber:
|
||||||
- `nvidia.nix` – proprietäre Treiber (unabhängig von Mesa)
|
- `nvidia.nix` – proprietäre Treiber (unabhängig von Mesa)
|
||||||
@@ -332,7 +332,7 @@ Mehr Infos: https://github.com/chaotic-cx/nyx
|
|||||||
|
|
||||||
| Situation | Empfehlung |
|
| Situation | Empfehlung |
|
||||||
|-----------|-----------|
|
|-----------|-----------|
|
||||||
| **Neue AMD-GPU + Gaming** | Mesa-Git aktivieren ✅ |
|
| **Neue AMD-GPU + Gaming** | Mesa-Git aktivieren |
|
||||||
| **Alte/Legacy Hardware** | Mesa-Git deaktivieren |
|
| **Alte/Legacy Hardware** | Mesa-Git deaktivieren |
|
||||||
| **NVIDIA** | Ignorieren (braucht nicht Mesa) |
|
| **NVIDIA** | Ignorieren (braucht nicht Mesa) |
|
||||||
| **Stabilität wichtiger als Perf** | Mesa-Git deaktivieren |
|
| **Stabilität wichtiger als Perf** | Mesa-Git deaktivieren |
|
||||||
@@ -343,4 +343,4 @@ Mehr Infos: https://github.com/chaotic-cx/nyx
|
|||||||
|
|
||||||
**Kurz:** Mesa-Git = Neueste AMD-GPU-Treiber für Gaming. Gut für Gaming, fallback hilft bei Problemen.
|
**Kurz:** Mesa-Git = Neueste AMD-GPU-Treiber für Gaming. Gut für Gaming, fallback hilft bei Problemen.
|
||||||
|
|
||||||
Alles klar? 🚀
|
Alles klar?
|
||||||
|
|||||||
+13
-13
@@ -14,11 +14,11 @@ Podman = Direkt auf deinem User-Account
|
|||||||
```
|
```
|
||||||
|
|
||||||
**Vorteile:**
|
**Vorteile:**
|
||||||
- ✅ Kein Root-Daemon nötig
|
- Kein Root-Daemon nötig
|
||||||
- ✅ Sicherer (läuft als normaler User)
|
- Sicherer (läuft als normaler User)
|
||||||
- ✅ Docker-kompatibel (`docker` CLI funktioniert)
|
- Docker-kompatibel (`docker` CLI funktioniert)
|
||||||
- ✅ Leichter als Docker
|
- Leichter als Docker
|
||||||
- ✅ Perfekt für Einzelnutzer
|
- Perfekt für Einzelnutzer
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -122,9 +122,9 @@ exit
|
|||||||
distrobox list
|
distrobox list
|
||||||
|
|
||||||
# Output:
|
# Output:
|
||||||
# NAME | STATUS | IMAGE NAME
|
# NAME | STATUS | IMAGE NAME
|
||||||
# ubuntu-dev | CREATED | ubuntu:latest
|
# ubuntu-dev | CREATED | ubuntu:latest
|
||||||
# alpine-work | EXITED | alpine:latest
|
# alpine-work | EXITED | alpine:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
### Container löschen
|
### Container löschen
|
||||||
@@ -346,11 +346,11 @@ Nutzen wenn:
|
|||||||
### NICHT für Gaming!
|
### NICHT für Gaming!
|
||||||
|
|
||||||
```
|
```
|
||||||
❌ Spiele laufen nicht in Distrobox
|
Spiele laufen nicht in Distrobox
|
||||||
❌ GameMode funktioniert nicht im Container
|
GameMode funktioniert nicht im Container
|
||||||
❌ GPU-Zugriff kompliziert
|
GPU-Zugriff kompliziert
|
||||||
|
|
||||||
✅ Nutze Bare Metal für Gaming
|
Nutze Bare Metal für Gaming
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -373,4 +373,4 @@ Nutzen wenn:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Podman ist dein neuer Docker-Ersatz auf NixOS!** 🐳→📦
|
**Podman ist dein neuer Docker-Ersatz auf NixOS!** →
|
||||||
|
|||||||
+18
-18
@@ -14,13 +14,13 @@ cd ~/nixos-config
|
|||||||
```
|
```
|
||||||
|
|
||||||
**Was wird geklont?**
|
**Was wird geklont?**
|
||||||
- ✅ `flake.nix` – Die Eingangsdatei
|
- `flake.nix` – Die Eingangsdatei
|
||||||
- ✅ `flake.lock` – Gepinnte Versionen für reproduzierbare Builds
|
- `flake.lock` – Gepinnte Versionen für reproduzierbare Builds
|
||||||
- ✅ Alle Module im `modules/`-Verzeichnis
|
- Alle Module im `modules/`-Verzeichnis
|
||||||
- ✅ `configuration.nix` – Basis-Config
|
- `configuration.nix` – Basis-Config
|
||||||
- ✅ `hardware-configuration.nix` – Host-spezifische Beispiel-/Ausgangsdatei
|
- `hardware-configuration.nix` – Host-spezifische Beispiel-/Ausgangsdatei
|
||||||
- ✅ Alle `.md`-Dateien (Anleitungen)
|
- Alle `.md`-Dateien (Anleitungen)
|
||||||
- ✅ Git-History
|
- Git-History
|
||||||
|
|
||||||
**Was musst du trotzdem prüfen?**
|
**Was musst du trotzdem prüfen?**
|
||||||
- `hardware-configuration.nix` muss zu deinem Rechner passen.
|
- `hardware-configuration.nix` muss zu deinem Rechner passen.
|
||||||
@@ -71,7 +71,7 @@ Alle starten mit denselben Input-Versionen.
|
|||||||
|
|
||||||
## Stable vs Unstable - Was sollte im Repo sein?
|
## Stable vs Unstable - Was sollte im Repo sein?
|
||||||
|
|
||||||
### Aktuelle Wahl: `nixos-unstable` ✅ (Richtig!)
|
### Aktuelle Wahl: `nixos-unstable` (Richtig!)
|
||||||
|
|
||||||
**flake.nix sagt:**
|
**flake.nix sagt:**
|
||||||
```nix
|
```nix
|
||||||
@@ -83,10 +83,10 @@ nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|||||||
| Kriterium | Stable | Unstable |
|
| Kriterium | Stable | Unstable |
|
||||||
|-----------|--------|----------|
|
|-----------|--------|----------|
|
||||||
| **Stabilität** | Hoch | Mittel (aber gut getestet) |
|
| **Stabilität** | Hoch | Mittel (aber gut getestet) |
|
||||||
| **Aktuelle Treiber** | ⚠️ Verzögert | ✅ Täglich neu |
|
| **Aktuelle Treiber** | Verzögert | Täglich neu |
|
||||||
| **Gaming** | Funktioniert | **Optimal** |
|
| **Gaming** | Funktioniert | **Optimal** |
|
||||||
| **Mesa-Git** | ❌ Nicht möglich | ✅ Ja |
|
| **Mesa-Git** | Nicht möglich | Ja |
|
||||||
| **Chaotic-Nyx** | ❌ Nicht kompatibel | ✅ Ja |
|
| **Chaotic-Nyx** | Nicht kompatibel | Ja |
|
||||||
| **Steam/Proton** | Funktioniert | **Neuste Fixes** |
|
| **Steam/Proton** | Funktioniert | **Neuste Fixes** |
|
||||||
|
|
||||||
**Conclusion:** `nixos-unstable` ist die richtige Wahl für Gaming + Chaotic-Nyx.
|
**Conclusion:** `nixos-unstable` ist die richtige Wahl für Gaming + Chaotic-Nyx.
|
||||||
@@ -170,9 +170,9 @@ graphicsConfig = ./modules/graphics/mesa-amd.nix; # oder nvidia.nix, etc.
|
|||||||
Dieses Repo nutzt bereits **Chaotic-Nyx Cachix** (vorkompilierte Pakete).
|
Dieses Repo nutzt bereits **Chaotic-Nyx Cachix** (vorkompilierte Pakete).
|
||||||
|
|
||||||
Das bedeutet:
|
Das bedeutet:
|
||||||
- ✅ Builds sind 4-6x schneller
|
- Builds sind 4-6x schneller
|
||||||
- ✅ Statt 90 Min → nur 15-30 Min
|
- Statt 90 Min → nur 15-30 Min
|
||||||
- ✅ Automatisch aktiviert, kein Setup nötig
|
- Automatisch aktiviert, kein Setup nötig
|
||||||
|
|
||||||
**Mehr Infos:** Siehe [`CACHIX_ANLEITUNG.md`](CACHIX_ANLEITUNG.md)
|
**Mehr Infos:** Siehe [`CACHIX_ANLEITUNG.md`](CACHIX_ANLEITUNG.md)
|
||||||
|
|
||||||
@@ -390,14 +390,14 @@ flake.lock = reproduzierbare Input-Versionen
|
|||||||
### Richtig versionieren
|
### Richtig versionieren
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# ✅ Immer committen:
|
# Immer committen:
|
||||||
- flake.nix (Eingabe-Definition)
|
- flake.nix (Eingabe-Definition)
|
||||||
- flake.lock (Input-Versionen)
|
- flake.lock (Input-Versionen)
|
||||||
- configuration.nix (Config)
|
- configuration.nix (Config)
|
||||||
- modules/ (Die ganzen Module)
|
- modules/ (Die ganzen Module)
|
||||||
- *.md (Dokumentation)
|
- *.md (Dokumentation)
|
||||||
|
|
||||||
# ⚠️ Nur committen, wenn das Repo wirklich genau diesen Host beschreibt:
|
# Nur committen, wenn das Repo wirklich genau diesen Host beschreibt:
|
||||||
- hardware-configuration.nix
|
- hardware-configuration.nix
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -438,9 +438,9 @@ git pull upstream main
|
|||||||
| **Stable oder Unstable?** | `nixos-unstable` (für Gaming optimal) |
|
| **Stable oder Unstable?** | `nixos-unstable` (für Gaming optimal) |
|
||||||
| **Mesa-Git automatisch?** | Ja, aktiviert in modules/chaotic-nyx.nix |
|
| **Mesa-Git automatisch?** | Ja, aktiviert in modules/chaotic-nyx.nix |
|
||||||
| **Kann ich den Desktop wechseln?** | Ja, einfach die Zeile in configuration.nix ändern |
|
| **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` |
|
| **Wie update ich später?** | `nixos-update` oder `nixos-update update-inputs` |
|
||||||
| **Kann ich meine Anpassungen speichern?** | Ja, in Unterordnern oder neuen Modulen |
|
| **Kann ich meine Anpassungen speichern?** | Ja, in Unterordnern oder neuen Modulen |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Alles klar? Jetzt können deine Freunde direkt loslegen!** 🚀
|
**Alles klar? Jetzt können deine Freunde direkt loslegen!**
|
||||||
|
|||||||
@@ -0,0 +1,73 @@
|
|||||||
|
# NixOS Update
|
||||||
|
|
||||||
|
`nixos-update` ist der eingebaute Update-Helfer für dieses Repo. Er zieht zuerst den neuesten Stand aus Git und führt danach `nixos-rebuild` mit deiner lokalen Flake-Konfiguration aus.
|
||||||
|
|
||||||
|
Der Befehl wird über [`modules/updater.nix`](../modules/updater.nix) ins System installiert.
|
||||||
|
|
||||||
|
## Repo im Modul setzen
|
||||||
|
|
||||||
|
Repo-Pfad und Flake-Ziel stehen direkt in `modules/updater.nix`. Für Freunde und für ein dauerhaftes System-Repo ist `/etc/nixos` der empfohlene Ort.
|
||||||
|
|
||||||
|
```nix
|
||||||
|
repo_root="/etc/nixos"
|
||||||
|
flake_target="template"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Standard
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nixos-update
|
||||||
|
```
|
||||||
|
|
||||||
|
Das ist der normale Alltagsfall:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git pull --ff-only
|
||||||
|
sudo nixos-rebuild switch --flake /pfad/zum/repo#<flake_target>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Modi
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nixos-update switch
|
||||||
|
nixos-update boot
|
||||||
|
```
|
||||||
|
|
||||||
|
- `switch` aktiviert die neue Generation sofort. Das ist auch der Standard.
|
||||||
|
- `boot` baut die neue Generation, aktiviert sie aber erst für den nächsten Neustart.
|
||||||
|
|
||||||
|
## Weitere Optionen
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nixos-update update-inputs
|
||||||
|
nixos-update dry-run
|
||||||
|
```
|
||||||
|
|
||||||
|
- `update-inputs` führt vor dem Rebuild noch `nix flake update` aus.
|
||||||
|
- `dry-run` zeigt die Schritte und Befehle an, ohne sie auszuführen.
|
||||||
|
|
||||||
|
## Typische Beispiele
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nixos-update
|
||||||
|
nixos-update update-inputs
|
||||||
|
nixos-update boot
|
||||||
|
nixos-update boot update-inputs
|
||||||
|
nixos-update dry-run
|
||||||
|
```
|
||||||
|
|
||||||
|
## Hinweise
|
||||||
|
|
||||||
|
- Das Skript nutzt `git pull --ff-only`. Wenn dein lokaler Branch und der Remote auseinanderlaufen, stoppt der Pull bewusst.
|
||||||
|
- Wenn `repo_root` für den normalen Benutzer nicht beschreibbar ist, laufen Git- und Flake-Befehle mit `sudo`. Das passt besonders für `/etc/nixos`.
|
||||||
|
- Vor jedem größeren Schritt zeigt das Skript den Abschnitt und den konkreten Befehl an.
|
||||||
|
- Bei lokalen uncommitteten Änderungen erscheint vor dem Pull eine Warnung.
|
||||||
|
- `nixos-update` fragt per `sudo -v` nach deinem Passwort, sobald es sudo wirklich braucht.
|
||||||
|
- `nixos-sync` und `update-nixos` bleiben als Alias erhalten und rufen intern ebenfalls `nixos-update` auf.
|
||||||
|
- Wenn du das Repo an einen anderen Ort legst, ändere `repo_root` direkt in `modules/updater.nix`.
|
||||||
|
|
||||||
|
## Hilfe
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nixos-update help
|
||||||
|
```
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
xdg.portal.enable = true;
|
xdg.portal.enable = true;
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
# Schlanke COSMIC-Basis fuer den Alltag
|
# Schlanke COSMIC-Basis für den Alltag
|
||||||
gnome-keyring
|
gnome-keyring
|
||||||
networkmanagerapplet
|
networkmanagerapplet
|
||||||
seahorse
|
seahorse
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
# für extrem aggressive Gaming-Performance
|
# für extrem aggressive Gaming-Performance
|
||||||
|
|
||||||
boot.kernelParams = [
|
boot.kernelParams = [
|
||||||
# ⚠️ WARNUNG: Deaktiviert Spectre/Meltdown-Mitigations!
|
# WARNUNG: Deaktiviert Spectre/Meltdown-Mitigations!
|
||||||
# Sicherheitsrisiko, aber +20-30% Performance
|
# Sicherheitsrisiko, aber +20-30% Performance
|
||||||
# Nur für Offline-Gaming PCs empfohlen!
|
# Nur für Offline-Gaming PCs empfohlen!
|
||||||
# "mitigations=off"
|
# "mitigations=off"
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
STEAM_EXTRA_COMPAT_TOOLS_PATHS = "$HOME/.steam/root/compatibilitytools.d";
|
STEAM_EXTRA_COMPAT_TOOLS_PATHS = "$HOME/.steam/root/compatibilitytools.d";
|
||||||
};
|
};
|
||||||
|
|
||||||
# ℹ️ PROTON-GE & PROTON-CACHYOS sind NICHT in nixpkgs!
|
# PROTON-GE & PROTON-CACHYOS sind NICHT in nixpkgs!
|
||||||
#
|
#
|
||||||
# Warum nicht?
|
# Warum nicht?
|
||||||
# - Community-Builds mit häufigen Updates (täglich/wöchentlich)
|
# - Community-Builds mit häufigen Updates (täglich/wöchentlich)
|
||||||
@@ -39,5 +39,3 @@
|
|||||||
# LÖSUNG 3: Chaotic-Nyx (bereits im Repo!)
|
# LÖSUNG 3: Chaotic-Nyx (bereits im Repo!)
|
||||||
# Chaotic-Nyx hat viele Gaming-Tools, aber nicht Proton-GE/CachyOS
|
# Chaotic-Nyx hat viele Gaming-Tools, aber nicht Proton-GE/CachyOS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
# Aktiviert die erweiterten AMDGPU-Features, damit LACT auch OC/UV setzen kann.
|
||||||
|
boot.kernelParams = [ "amdgpu.ppfeaturemask=0xffffffff" ];
|
||||||
|
|
||||||
hardware.graphics = {
|
hardware.graphics = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enable32Bit = true;
|
enable32Bit = true;
|
||||||
@@ -15,6 +18,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
services.xserver.videoDrivers = [ "amdgpu" ];
|
services.xserver.videoDrivers = [ "amdgpu" ];
|
||||||
|
services.lact.enable = true;
|
||||||
|
|
||||||
hardware.amdgpu = {
|
hardware.amdgpu = {
|
||||||
initrd.enable = true;
|
initrd.enable = true;
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
# Aktiviert die erweiterten AMDGPU-Features, damit LACT auch OC/UV setzen kann.
|
||||||
|
boot.kernelParams = [ "amdgpu.ppfeaturemask=0xffffffff" ];
|
||||||
|
|
||||||
hardware.graphics = {
|
hardware.graphics = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enable32Bit = true;
|
enable32Bit = true;
|
||||||
|
|||||||
@@ -0,0 +1,159 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
script = ''
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# Wenn dein NixOS-Repo nicht in /etc/nixos liegt, diesen Pfad hier anpassen.
|
||||||
|
repo_root="/etc/nixos"
|
||||||
|
|
||||||
|
# Das muss zum Namen in flake.nix unter nixosConfigurations.<name> passen.
|
||||||
|
flake_target="template"
|
||||||
|
rebuild_mode="switch"
|
||||||
|
update_inputs=false
|
||||||
|
dry_run=false
|
||||||
|
needs_sudo=false
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
cat <<'EOF'
|
||||||
|
Usage: nixos-update [switch|boot] [update-inputs] [dry-run]
|
||||||
|
|
||||||
|
Syncs this repo and rebuilds NixOS from the local flake config.
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
switch Build and activate the new system immediately
|
||||||
|
boot Build and activate for next boot instead of switching now
|
||||||
|
update-inputs Run `nix flake update` before rebuilding
|
||||||
|
dry-run Show commands without executing them
|
||||||
|
help Show this help
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
while [[ $# -gt 0 ]]; do
|
||||||
|
case "$1" in
|
||||||
|
update-inputs)
|
||||||
|
update_inputs=true
|
||||||
|
;;
|
||||||
|
switch)
|
||||||
|
rebuild_mode="switch"
|
||||||
|
;;
|
||||||
|
boot)
|
||||||
|
rebuild_mode="boot"
|
||||||
|
;;
|
||||||
|
dry-run)
|
||||||
|
dry_run=true
|
||||||
|
;;
|
||||||
|
help|-h|--help)
|
||||||
|
usage
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unknown option: $1" >&2
|
||||||
|
usage >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
step() {
|
||||||
|
printf '\n==> %s\n' "$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
print_command() {
|
||||||
|
printf ' $'
|
||||||
|
printf ' %q' "$@"
|
||||||
|
printf '\n'
|
||||||
|
}
|
||||||
|
|
||||||
|
run() {
|
||||||
|
print_command "$@"
|
||||||
|
|
||||||
|
if [[ "$dry_run" == true ]]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
"$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
run_repo() {
|
||||||
|
if [[ "$needs_sudo" == true ]]; then
|
||||||
|
run sudo "$@"
|
||||||
|
else
|
||||||
|
run "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "Repo: $repo_root"
|
||||||
|
echo "Flake target: $flake_target"
|
||||||
|
echo "Rebuild mode: $rebuild_mode"
|
||||||
|
|
||||||
|
if [[ ! -d "$repo_root" ]]; then
|
||||||
|
echo "Repo path does not exist: $repo_root" >&2
|
||||||
|
echo "Adjust repo_root in modules/updater.nix or move the repo to that path." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -w "$repo_root" ]]; then
|
||||||
|
needs_sudo=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$needs_sudo" == true ]]; then
|
||||||
|
echo "Repo ist nicht als normaler Benutzer beschreibbar. Git- und Flake-Befehle laufen mit sudo."
|
||||||
|
step "Prüfe sudo"
|
||||||
|
run sudo -v
|
||||||
|
fi
|
||||||
|
|
||||||
|
step "Wechsle ins Repo"
|
||||||
|
print_command cd "$repo_root"
|
||||||
|
cd "$repo_root"
|
||||||
|
|
||||||
|
if [[ "$needs_sudo" == true ]]; then
|
||||||
|
git_check=(sudo git rev-parse --is-inside-work-tree)
|
||||||
|
else
|
||||||
|
git_check=(git rev-parse --is-inside-work-tree)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! "''${git_check[@]}" >/dev/null 2>&1; then
|
||||||
|
echo "Repo path is not a Git repository: $repo_root" >&2
|
||||||
|
echo "Clone your config repo there or adjust repo_root in modules/updater.nix." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! run_repo git diff --quiet || ! run_repo git diff --cached --quiet; then
|
||||||
|
echo "Working tree has local changes. git pull may fail if upstream changed the same files."
|
||||||
|
fi
|
||||||
|
|
||||||
|
step "Aktualisiere Git-Repo"
|
||||||
|
run_repo git pull --ff-only
|
||||||
|
|
||||||
|
if [[ "$update_inputs" == true ]]; then
|
||||||
|
step "Aktualisiere Flake-Inputs"
|
||||||
|
run_repo nix flake update
|
||||||
|
fi
|
||||||
|
|
||||||
|
step "Prüfe sudo für den NixOS-Rebuild"
|
||||||
|
run sudo -v
|
||||||
|
|
||||||
|
step "Starte nixos-rebuild"
|
||||||
|
run sudo nixos-rebuild "$rebuild_mode" --flake "$repo_root#$flake_target"
|
||||||
|
'';
|
||||||
|
|
||||||
|
nixosUpdate = pkgs.writeShellScriptBin "nixos-update" script;
|
||||||
|
|
||||||
|
updateNixosCompat = pkgs.writeShellScriptBin "update-nixos" ''
|
||||||
|
exec ${nixosUpdate}/bin/nixos-update "$@"
|
||||||
|
'';
|
||||||
|
|
||||||
|
nixosSyncCompat = pkgs.writeShellScriptBin "nixos-sync" ''
|
||||||
|
exec ${nixosUpdate}/bin/nixos-update "$@"
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
environment.systemPackages = [
|
||||||
|
nixosUpdate
|
||||||
|
nixosSyncCompat
|
||||||
|
updateNixosCompat
|
||||||
|
];
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user