commit 41ff233f3179bad8546f1012b9e3426bef852f68 Author: Max P Date: Wed Jun 10 18:36:32 2026 +0200 Initial import diff --git a/README.md b/README.md new file mode 100644 index 0000000..d6f02d1 --- /dev/null +++ b/README.md @@ -0,0 +1,79 @@ +# NixOS Gaming Base + +Diese Basis-Config ist fuer ein Desktop-System mit + +- Intel Core i9-13900KF +- AMD Radeon RX 9070 XT + +ausgelegt und nutzt jetzt `nixos-unstable`, `Chaotic-Nyx` und COSMIC als Wayland-Desktop. Fokus: + +- aktueller Kernel +- AMD-Grafik mit Chaotic `mesa-git` und 32-Bit-Libs fuer Steam/Proton +- PipeWire + Gaming-/Desktop-Audio-Tools +- Steam, Gamescope, MangoHud, Lutris, Heroic, LACT +- RGB- und Peripherie-Basis fuer deine USB-Geraete + +## Struktur + +- `flake.nix`: Einstieg ueber `nixos-unstable` + `chaotic-cx/nyx` +- `configuration.nix`: Host-spezifische Einstiegsdatei +- `modules/base.nix`: Boot, Kernel, Locale, Nix, Firmware, Governor +- `modules/chaotic-nyx.nix`: Chaotic-Nyx Aktivierung, `allowUnfree`, `mesa-git` +- `modules/graphics/mesa-amd.nix`: AMDGPU + Mesa/RADV Basis +- `modules/audio/pipewire.nix`: PipeWire, JACK, Pulse, Audio-Tools +- `modules/gaming.nix`: Steam, Gamescope, Wine/Launcher-Stack +- `modules/desktop/cosmic.nix`: COSMIC Desktop + COSMIC Greeter +- `modules/peripherals.nix`: OpenRGB, Logitech/Corsair-nahe Tools, USB-Helfer + +## USB-Bezug + +Die Config beruecksichtigt diese aktuell erkannten Geraete: + +- `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 fuer das Scarlett Solo +- COSMIC als Wayland-Desktop mit `cosmic-greeter` +- Chaotic `mesa-git` mit Fallback-Spezialisierung `stable-mesa` + +## Chaotic-Nyx Hinweis + +Die Flake bindet `github:chaotic-cx/nyx/nyxpkgs-unstable` direkt ein und importiert +`chaotic.nixosModules.default`. +`modules/chaotic-nyx.nix` aktiviert `chaotic.mesa-git.enable = true;`. + +## Nach der Installation + +1. Die vom Installer erzeugte `hardware-configuration.nix` nach `./hardware-configuration.nix` kopieren. +2. Falls noetig `users.users.max` und `networking.hostName` in `configuration.nix` anpassen. +3. Passwort fuer den Benutzer setzen: + +```bash +passwd max +``` + +4. Flake lock erstellen: + +```bash +nix flake lock +``` + +5. System aktivieren: + +```bash +sudo nixos-rebuild switch --flake .#nixos-gaming +``` + +## Spaeterer Ausbau + +- COSMIC 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..a4efc76 --- /dev/null +++ b/configuration.nix @@ -0,0 +1,30 @@ +{ ... }: + +{ + imports = [ + ./hardware-configuration.nix + ./modules/base.nix + ./modules/audio/pipewire.nix + ./modules/chaotic-nyx.nix + ./modules/graphics/mesa-amd.nix + ./modules/desktop/cosmic.nix + ./modules/gaming.nix + ./modules/peripherals.nix + ]; + + networking.hostName = "nixos-gaming"; + + users.users.max = { + isNormalUser = true; + description = "max"; + extraGroups = [ + "wheel" + "networkmanager" + "audio" + "video" + "input" + ]; + }; + + system.stateVersion = "25.05"; +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..1101f55 --- /dev/null +++ b/flake.nix @@ -0,0 +1,29 @@ +{ + description = "Gaming-focused NixOS config with COSMIC and Chaotic-Nyx"; + + 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.nixos-gaming = 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..de215a7 --- /dev/null +++ b/hardware-configuration.nix @@ -0,0 +1,5 @@ +{ ... }: + +{ + # Replace this file with the installer-generated hardware-configuration.nix. +} diff --git a/modules/audio/pipewire.nix b/modules/audio/pipewire.nix new file mode 100644 index 0000000..381f6fa --- /dev/null +++ b/modules/audio/pipewire.nix @@ -0,0 +1,20 @@ +{ pkgs, ... }: + +{ + hardware.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..4a3eec8 --- /dev/null +++ b/modules/base.nix @@ -0,0 +1,48 @@ +{ config, lib, pkgs, ... }: + +{ + boot = { + loader.systemd-boot.enable = true; + loader.efi.canTouchEfiVariables = true; + kernelPackages = pkgs.linuxPackages_latest; + supportedFilesystems = [ "ntfs" ]; + + # Helpful for large games, shader caches and some launchers. + kernel.sysctl = { + "fs.inotify.max_user_watches" = 1048576; + "vm.max_map_count" = 2147483642; + }; + }; + + networking.networkmanager.enable = true; + + time.timeZone = "Europe/Berlin"; + + i18n.defaultLocale = "de_DE.UTF-8"; + console.keyMap = "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; + }; + + services.fwupd.enable = true; + + powerManagement.cpuFreqGovernor = lib.mkDefault "performance"; +} 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/desktop/cosmic.nix b/modules/desktop/cosmic.nix new file mode 100644 index 0000000..2abc11d --- /dev/null +++ b/modules/desktop/cosmic.nix @@ -0,0 +1,19 @@ +{ pkgs, ... }: + +{ + services.desktopManager.cosmic = { + enable = true; + xwayland.enable = true; + }; + + services.displayManager.cosmic-greeter.enable = true; + + environment.systemPackages = with pkgs; [ + gnome-keyring + networkmanagerapplet + seahorse + wayland-utils + wl-clipboard + xwayland + ]; +} diff --git a/modules/gaming.nix b/modules/gaming.nix new file mode 100644 index 0000000..c291560 --- /dev/null +++ b/modules/gaming.nix @@ -0,0 +1,33 @@ +{ pkgs, ... }: + +{ + 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; + protontricks.enable = true; + }; + }; + + environment.systemPackages = with pkgs; [ + gamemode + goverlay + heroic + lact + lutris + mangohud + protontricks + steam-run + wineWowPackages.stable + winetricks + ]; +} diff --git a/modules/graphics/mesa-amd.nix b/modules/graphics/mesa-amd.nix new file mode 100644 index 0000000..87bf101 --- /dev/null +++ b/modules/graphics/mesa-amd.nix @@ -0,0 +1,15 @@ +{ pkgs, ... }: + +{ + hardware.graphics = { + enable = true; + enable32Bit = true; + }; + + services.xserver.videoDrivers = [ "amdgpu" ]; + + environment.systemPackages = with pkgs; [ + mesa-demos + vulkan-tools + ]; +} diff --git a/modules/peripherals.nix b/modules/peripherals.nix new file mode 100644 index 0000000..8522937 --- /dev/null +++ b/modules/peripherals.nix @@ -0,0 +1,27 @@ +{ 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 + ]; + + # 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 +}