Update
This commit is contained in:
@@ -1,17 +1,13 @@
|
|||||||
# NixOS Gaming Base
|
# NixOS Gaming Base
|
||||||
|
|
||||||
Diese Basis-Config ist für ein Desktop-System mit
|
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:
|
||||||
|
|
||||||
- Intel Core i9-13900KF
|
|
||||||
- AMD Radeon RX 9070 XT
|
|
||||||
|
|
||||||
ausgelegt und nutzt `nixos-unstable`, `Chaotic-Nyx` und eine waehlbare Desktop-Umgebung. Fokus:
|
|
||||||
|
|
||||||
- aktueller Kernel
|
- 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
|
- PipeWire + Gaming-/Desktop-Audio-Tools
|
||||||
- Steam, Gamescope, MangoHud, Lutris, Heroic, LACT
|
- 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
|
- Desktop-Auswahl zwischen KDE, GNOME, Budgie und Hyprland
|
||||||
|
|
||||||
## Struktur
|
## 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`
|
- `flake.nix`: Einstieg über `nixos-unstable` + `chaotic-cx/nyx`
|
||||||
- `configuration.nix`: Host-spezifische Einstiegsdatei
|
- `configuration.nix`: Host-spezifische Einstiegsdatei
|
||||||
- `modules/base.nix`: Boot, Kernel, Locale, Nix, Firmware, Governor
|
- `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/chaotic-nyx.nix`: Chaotic-Nyx Aktivierung, `allowUnfree`, `mesa-git`
|
||||||
- `modules/graphics/mesa-amd.nix`: AMDGPU + Mesa/RADV Basis
|
- `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/audio/pipewire.nix`: PipeWire, JACK, Pulse, Audio-Tools
|
||||||
- `modules/gaming.nix`: Steam, Gamescope, Wine/Launcher-Stack
|
- `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/kde.nix`: KDE Plasma 6 + SDDM
|
||||||
- `modules/desktop/gnome.nix`: GNOME + GDM
|
- `modules/desktop/gnome.nix`: GNOME + GDM
|
||||||
- `modules/desktop/budgie.nix`: Budgie
|
- `modules/desktop/budgie.nix`: Budgie
|
||||||
- `modules/desktop/hyprland.nix`: Hyprland + SDDM
|
- `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:
|
Die wichtigsten Platzhalter stehen direkt in `configuration.nix`:
|
||||||
|
|
||||||
- `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`:
|
|
||||||
|
|
||||||
```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"`
|
## Desktop auswählen
|
||||||
- `"gnome"`
|
|
||||||
- `"budgie"`
|
Die Auswahl passiert zentral in `configuration.nix` über `desktopConfig`:
|
||||||
- `"hyprland"`
|
|
||||||
|
```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
|
## Chaotic-Nyx Hinweis
|
||||||
|
|
||||||
@@ -72,24 +82,25 @@ Die Flake bindet `github:chaotic-cx/nyx/nyxpkgs-unstable` direkt ein und importi
|
|||||||
## Nach der Installation
|
## Nach der Installation
|
||||||
|
|
||||||
1. Die vom Installer erzeugte `hardware-configuration.nix` nach `./hardware-configuration.nix` kopieren.
|
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.
|
2. `hostName`, `userName` und `fullName` in `configuration.nix` anpassen.
|
||||||
3. Gewuenschten Desktop ueber `profiles.desktop` in `configuration.nix` setzen.
|
3. Gewünschten Desktop und ggf. Grafiktreiber in `configuration.nix` auswählen.
|
||||||
4. Passwort fuer den Benutzer setzen:
|
4. Optional Locale, Tastatur und Zeitzone anpassen.
|
||||||
|
5. Passwort für den Benutzer setzen:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
passwd max
|
passwd <dein-userName>
|
||||||
```
|
```
|
||||||
|
|
||||||
5. Flake lock erstellen:
|
6. Flake lock erstellen:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
nix flake lock
|
nix flake lock
|
||||||
```
|
```
|
||||||
|
|
||||||
6. System aktivieren:
|
7. System aktivieren:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo nixos-rebuild switch --flake .#nixos-gaming
|
sudo nixos-rebuild switch --flake .#template
|
||||||
```
|
```
|
||||||
|
|
||||||
## Späterer Ausbau
|
## Späterer Ausbau
|
||||||
|
|||||||
+24
-9
@@ -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 = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./modules/base.nix
|
./modules/base.nix
|
||||||
|
./modules/packages.nix
|
||||||
./modules/audio/pipewire.nix
|
./modules/audio/pipewire.nix
|
||||||
./modules/chaotic-nyx.nix
|
./modules/chaotic-nyx.nix
|
||||||
./modules/graphics/mesa-amd.nix
|
graphicsConfig
|
||||||
./modules/desktop
|
./modules/desktop/common.nix
|
||||||
|
desktopConfig
|
||||||
./modules/gaming.nix
|
./modules/gaming.nix
|
||||||
./modules/peripherals.nix
|
./modules/peripherals.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
networking.hostName = "nixos-gaming";
|
networking.hostName = hostName;
|
||||||
|
|
||||||
profiles.desktop = "kde";
|
users.users.${userName} = {
|
||||||
# Moegliche Werte: "kde" "gnome" "budgie" "hyprland"
|
|
||||||
|
|
||||||
users.users.max = {
|
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
description = "max";
|
description = fullName;
|
||||||
extraGroups = [
|
extraGroups = [
|
||||||
"wheel"
|
"wheel"
|
||||||
"networkmanager"
|
"networkmanager"
|
||||||
@@ -29,5 +44,5 @@
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
system.stateVersion = "25.05";
|
system.stateVersion = "26.05";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 = {
|
nixConfig = {
|
||||||
extra-substituters = [
|
extra-substituters = [
|
||||||
@@ -18,12 +18,14 @@
|
|||||||
outputs =
|
outputs =
|
||||||
{ nixpkgs, chaotic, ... }:
|
{ nixpkgs, chaotic, ... }:
|
||||||
{
|
{
|
||||||
nixosConfigurations.nixos-gaming = nixpkgs.lib.nixosSystem {
|
nixosConfigurations = {
|
||||||
system = "x86_64-linux";
|
template = nixpkgs.lib.nixosSystem {
|
||||||
modules = [
|
system = "x86_64-linux";
|
||||||
chaotic.nixosModules.default
|
modules = [
|
||||||
./configuration.nix
|
chaotic.nixosModules.default
|
||||||
];
|
./configuration.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-4
@@ -4,7 +4,7 @@
|
|||||||
boot = {
|
boot = {
|
||||||
loader.systemd-boot.enable = true;
|
loader.systemd-boot.enable = true;
|
||||||
loader.efi.canTouchEfiVariables = true;
|
loader.efi.canTouchEfiVariables = true;
|
||||||
kernelPackages = pkgs.linuxPackages_latest;
|
kernelPackages = pkgs.linuxPackages_cachyos;
|
||||||
supportedFilesystems = [ "ntfs" ];
|
supportedFilesystems = [ "ntfs" ];
|
||||||
|
|
||||||
# Helpful for large games, shader caches and some launchers.
|
# Helpful for large games, shader caches and some launchers.
|
||||||
@@ -16,10 +16,11 @@
|
|||||||
|
|
||||||
networking.networkmanager.enable = true;
|
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";
|
i18n.defaultLocale = lib.mkDefault "en_US.UTF-8";
|
||||||
console.keyMap = "de";
|
console.keyMap = lib.mkDefault "us";
|
||||||
|
|
||||||
nix.settings = {
|
nix.settings = {
|
||||||
experimental-features = [ "nix-command" "flakes" ];
|
experimental-features = [ "nix-command" "flakes" ];
|
||||||
@@ -40,6 +41,7 @@
|
|||||||
hardware = {
|
hardware = {
|
||||||
enableRedistributableFirmware = true;
|
enableRedistributableFirmware = true;
|
||||||
cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
};
|
};
|
||||||
|
|
||||||
services.fwupd.enable = true;
|
services.fwupd.enable = true;
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
{ config, lib, ... }:
|
{ ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
config = lib.mkIf (config.profiles.desktop == "budgie") {
|
services.xserver.enable = true;
|
||||||
services.xserver.enable = true;
|
services.desktopManager.budgie.enable = true;
|
||||||
services.desktopManager.budgie.enable = true;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
seahorse
|
||||||
|
wayland-utils
|
||||||
|
wl-clipboard
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -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,13 +1,11 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
config = lib.mkIf (config.profiles.desktop == "gnome") {
|
services.xserver.enable = true;
|
||||||
services.xserver.enable = true;
|
services.displayManager.gdm.enable = true;
|
||||||
services.displayManager.gdm.enable = true;
|
services.desktopManager.gnome.enable = true;
|
||||||
services.desktopManager.gnome.enable = true;
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
gnome-tweaks
|
gnome-tweaks
|
||||||
];
|
];
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,20 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
config = lib.mkIf (config.profiles.desktop == "hyprland") {
|
services.displayManager.sddm = {
|
||||||
services.displayManager.sddm = {
|
enable = true;
|
||||||
enable = true;
|
wayland.enable = true;
|
||||||
wayland.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.hyprland = {
|
|
||||||
enable = true;
|
|
||||||
withUWSM = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
dunst
|
|
||||||
kitty
|
|
||||||
waybar
|
|
||||||
wofi
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
programs.hyprland = {
|
||||||
|
enable = true;
|
||||||
|
withUWSM = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
dunst
|
||||||
|
kitty
|
||||||
|
waybar
|
||||||
|
wofi
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
{ config, lib, ... }:
|
{ ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
config = lib.mkIf (config.profiles.desktop == "kde") {
|
services.xserver.enable = true;
|
||||||
services.xserver.enable = true;
|
|
||||||
|
|
||||||
services.displayManager.sddm = {
|
services.displayManager.sddm = {
|
||||||
enable = true;
|
enable = true;
|
||||||
wayland.enable = true;
|
wayland.enable = true;
|
||||||
};
|
|
||||||
|
|
||||||
services.desktopManager.plasma6.enable = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.desktopManager.plasma6.enable = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,12 +19,14 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
|
ftb-app
|
||||||
gamemode
|
gamemode
|
||||||
goverlay
|
goverlay
|
||||||
heroic
|
heroic
|
||||||
lact
|
lact
|
||||||
lutris
|
lutris
|
||||||
mangohud
|
mangohud
|
||||||
|
prismlauncher
|
||||||
protontricks
|
protontricks
|
||||||
steam-run
|
steam-run
|
||||||
wineWowPackages.stable
|
wineWowPackages.stable
|
||||||
|
|||||||
@@ -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
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Eigene Zusatzpakete kommen hier rein.
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -18,10 +18,4 @@
|
|||||||
solaar
|
solaar
|
||||||
usbutils
|
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
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user