This commit is contained in:
2026-06-10 19:34:36 +02:00
parent 5c4164ac11
commit bb427145df
14 changed files with 166 additions and 138 deletions
+54 -43
View File
@@ -1,17 +1,13 @@
# NixOS Gaming Base
Diese Basis-Config ist für ein Desktop-System mit
- Intel Core i9-13900KF
- AMD Radeon RX 9070 XT
ausgelegt und nutzt `nixos-unstable`, `Chaotic-Nyx` und eine waehlbare Desktop-Umgebung. Fokus:
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
- AMD-Grafik mit Chaotic `mesa-git` und 32-Bit-Libs für Steam/Proton
- 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
- RGB- und Peripherie-Basis fuer deine USB-Geraete
- Basis für RGB- und Gaming-Peripherie
- Desktop-Auswahl zwischen KDE, GNOME, Budgie und Hyprland
## Struktur
@@ -19,49 +15,63 @@ ausgelegt und nutzt `nixos-unstable`, `Chaotic-Nyx` und eine waehlbare Desktop-U
- `flake.nix`: Einstieg über `nixos-unstable` + `chaotic-cx/nyx`
- `configuration.nix`: Host-spezifische Einstiegsdatei
- `modules/base.nix`: Boot, Kernel, Locale, Nix, Firmware, Governor
- `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/nvidia.nix`: Nvidia-Treiber Basis
- `modules/audio/pipewire.nix`: PipeWire, JACK, Pulse, Audio-Tools
- `modules/gaming.nix`: Steam, Gamescope, Wine/Launcher-Stack
- `modules/desktop/default.nix`: Desktop-Auswahl ueber `profiles.desktop`
- `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/peripherals.nix`: OpenRGB, Logitech/Corsair-nahe Tools, USB-Helfer
- `modules/peripherals.nix`: RGB-, Maus- und USB-Helfer
## USB-Bezug
## Vorlage anpassen
Die Config berücksichtigt diese aktuell erkannten Geräte:
- `048d:5702` ITE RGB LED Controller
- `1235:8211` Focusrite Scarlett Solo 3rd Gen
- `1b1c:1bfd` Corsair K70 CORE RGB
- `046d:c539` Logitech Lightspeed Receiver
Daraus folgen aktuell:
- `openrgb` + `hardware.i2c.enable` fuer RGB-/Board-Zugriff
- `ratbagd` + `piper` fuer Logitech-Gaming-Peripherie
- `solaar`, `usbutils`, `pciutils` fuer Device-Handling und Diagnose
- PipeWire-Setup für das Scarlett Solo
- waehlbarer Desktop via `profiles.desktop`
- Chaotic `mesa-git` mit Fallback-Spezialisierung `stable-mesa`
## Desktop auswaehlen
Die Auswahl passiert zentral in `configuration.nix`:
Die wichtigsten Platzhalter stehen direkt in `configuration.nix`:
```nix
profiles.desktop = "kde";
hostName = "example-host";
userName = "gamer";
fullName = "Gaming User";
```
Gueltige Werte sind:
Passe diese Werte vor dem ersten Build an. In `modules/base.nix` sind `UTC`, `en_US.UTF-8` und `us` als neutrale Defaults gesetzt und können ebenfalls überschrieben werden.
Zusätzliche allgemeine Pakete kannst du in `modules/packages.nix` eintragen.
- `"kde"`
- `"gnome"`
- `"budgie"`
- `"hyprland"`
## Desktop auswählen
Die Auswahl passiert zentral in `configuration.nix` über `desktopConfig`:
```nix
desktopConfig = ./modules/desktop/kde.nix;
```
Mögliche Werte sind:
- `./modules/desktop/kde.nix`
- `./modules/desktop/gnome.nix`
- `./modules/desktop/budgie.nix`
- `./modules/desktop/hyprland.nix`
Es wird damit immer genau ein Desktop-Modul importiert, nicht alle auf einmal.
## Grafiktreiber auswählen
Die Grafik-Konfiguration läuft genauso über `graphicsConfig`:
```nix
graphicsConfig = ./modules/graphics/mesa-amd.nix;
```
Mögliche Werte sind:
- `./modules/graphics/mesa-amd.nix`
- `./modules/graphics/nvidia.nix`
In `modules/graphics/nvidia.nix` sind `modesetting`, `nvidiaSettings` und das stabile Treiberpaket bereits gesetzt.
## Chaotic-Nyx Hinweis
@@ -72,24 +82,25 @@ Die Flake bindet `github:chaotic-cx/nyx/nyxpkgs-unstable` direkt ein und importi
## Nach der Installation
1. Die vom Installer erzeugte `hardware-configuration.nix` nach `./hardware-configuration.nix` kopieren.
2. Falls nötig `users.users.max` und `networking.hostName` in `configuration.nix` anpassen.
3. Gewuenschten Desktop ueber `profiles.desktop` in `configuration.nix` setzen.
4. Passwort fuer den Benutzer setzen:
2. `hostName`, `userName` und `fullName` in `configuration.nix` anpassen.
3. Gewünschten Desktop und ggf. Grafiktreiber in `configuration.nix` auswählen.
4. Optional Locale, Tastatur und Zeitzone anpassen.
5. Passwort für den Benutzer setzen:
```bash
passwd max
passwd <dein-userName>
```
5. Flake lock erstellen:
6. Flake lock erstellen:
```bash
nix flake lock
```
6. System aktivieren:
7. System aktivieren:
```bash
sudo nixos-rebuild switch --flake .#nixos-gaming
sudo nixos-rebuild switch --flake .#template
```
## Späterer Ausbau
+24 -9
View File
@@ -1,25 +1,40 @@
{ ... }:
let
hostName = "example-host";
userName = "gamer";
fullName = "Gaming User";
# Desktop-Auswahl:
# ./modules/desktop/gnome.nix
# ./modules/desktop/budgie.nix
# ./modules/desktop/hyprland.nix
desktopConfig = ./modules/desktop/kde.nix;
# Grafiktreiber-Auswahl:
# ./modules/graphics/nvidia.nix
graphicsConfig = ./modules/graphics/mesa-amd.nix;
in
{
imports = [
./hardware-configuration.nix
./modules/base.nix
./modules/packages.nix
./modules/audio/pipewire.nix
./modules/chaotic-nyx.nix
./modules/graphics/mesa-amd.nix
./modules/desktop
graphicsConfig
./modules/desktop/common.nix
desktopConfig
./modules/gaming.nix
./modules/peripherals.nix
];
networking.hostName = "nixos-gaming";
networking.hostName = hostName;
profiles.desktop = "kde";
# Moegliche Werte: "kde" "gnome" "budgie" "hyprland"
users.users.max = {
users.users.${userName} = {
isNormalUser = true;
description = "max";
description = fullName;
extraGroups = [
"wheel"
"networkmanager"
@@ -29,5 +44,5 @@
];
};
system.stateVersion = "25.05";
system.stateVersion = "26.05";
}
+4 -2
View File
@@ -1,5 +1,5 @@
{
description = "Gaming-focused NixOS config with COSMIC and Chaotic-Nyx";
description = "Reusable NixOS gaming desktop template with selectable desktop and GPU modules";
nixConfig = {
extra-substituters = [
@@ -18,7 +18,8 @@
outputs =
{ nixpkgs, chaotic, ... }:
{
nixosConfigurations.nixos-gaming = nixpkgs.lib.nixosSystem {
nixosConfigurations = {
template = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
chaotic.nixosModules.default
@@ -26,4 +27,5 @@
];
};
};
};
}
+6 -4
View File
@@ -4,7 +4,7 @@
boot = {
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;
kernelPackages = pkgs.linuxPackages_latest;
kernelPackages = pkgs.linuxPackages_cachyos;
supportedFilesystems = [ "ntfs" ];
# Helpful for large games, shader caches and some launchers.
@@ -16,10 +16,11 @@
networking.networkmanager.enable = true;
time.timeZone = "Europe/Berlin";
# Override these in configuration.nix if you need local defaults.
time.timeZone = lib.mkDefault "UTC";
i18n.defaultLocale = "de_DE.UTF-8";
console.keyMap = "de";
i18n.defaultLocale = lib.mkDefault "en_US.UTF-8";
console.keyMap = lib.mkDefault "us";
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
@@ -40,6 +41,7 @@
hardware = {
enableRedistributableFirmware = true;
cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
};
services.fwupd.enable = true;
+1 -3
View File
@@ -1,8 +1,6 @@
{ config, lib, ... }:
{ ... }:
{
config = lib.mkIf (config.profiles.desktop == "budgie") {
services.xserver.enable = true;
services.desktopManager.budgie.enable = true;
};
}
+9
View File
@@ -0,0 +1,9 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
seahorse
wayland-utils
wl-clipboard
];
}
-28
View File
@@ -1,28 +0,0 @@
{ lib, pkgs, ... }:
{
imports = [
./budgie.nix
./gnome.nix
./hyprland.nix
./kde.nix
];
options.profiles.desktop = lib.mkOption {
type = lib.types.enum [
"kde"
"gnome"
"budgie"
"hyprland"
];
default = "kde";
example = "hyprland";
description = "Waehlt die Desktop-Umgebung fuer dieses System aus.";
};
config.environment.systemPackages = with pkgs; [
seahorse
wayland-utils
wl-clipboard
];
}
+1 -3
View File
@@ -1,7 +1,6 @@
{ config, lib, pkgs, ... }:
{ pkgs, ... }:
{
config = lib.mkIf (config.profiles.desktop == "gnome") {
services.xserver.enable = true;
services.displayManager.gdm.enable = true;
services.desktopManager.gnome.enable = true;
@@ -9,5 +8,4 @@
environment.systemPackages = with pkgs; [
gnome-tweaks
];
};
}
+1 -3
View File
@@ -1,7 +1,6 @@
{ config, lib, pkgs, ... }:
{ pkgs, ... }:
{
config = lib.mkIf (config.profiles.desktop == "hyprland") {
services.displayManager.sddm = {
enable = true;
wayland.enable = true;
@@ -18,5 +17,4 @@
waybar
wofi
];
};
}
+1 -3
View File
@@ -1,7 +1,6 @@
{ config, lib, ... }:
{ ... }:
{
config = lib.mkIf (config.profiles.desktop == "kde") {
services.xserver.enable = true;
services.displayManager.sddm = {
@@ -10,5 +9,4 @@
};
services.desktopManager.plasma6.enable = true;
};
}
+2
View File
@@ -19,12 +19,14 @@
};
environment.systemPackages = with pkgs; [
ftb-app
gamemode
goverlay
heroic
lact
lutris
mangohud
prismlauncher
protontricks
steam-run
wineWowPackages.stable
+22
View File
@@ -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
];
}
+7
View File
@@ -0,0 +1,7 @@
{ pkgs, ... }:
{
# Eigene Zusatzpakete kommen hier rein.
environment.systemPackages = with pkgs; [
];
}
-6
View File
@@ -18,10 +18,4 @@
solaar
usbutils
];
# Observed devices:
# - 048d:5702 Integrated Technology Express RGB LED Controller
# - 1235:8211 Focusrite Scarlett Solo (3rd Gen.)
# - 1b1c:1bfd Corsair K70 CORE RGB
# - 046d:c539 Logitech Lightspeed receiver
}