From 5bc78a031f94ba7c679657518d7c048cc432a39a Mon Sep 17 00:00:00 2001 From: 0xrsydn Date: Fri, 24 Oct 2025 11:08:12 +0700 Subject: [PATCH] init(release): desktop template -> desktop wip --- AGENTS.md | 18 +-- DESKTOP-SETUP.md | 132 ++++++++++++++++++ modules/home/rsydn/desktop/apps/browsers.nix | 19 +++ modules/home/rsydn/desktop/apps/terminals.nix | 28 ++++ modules/home/rsydn/desktop/base.nix | 36 +++++ modules/home/rsydn/desktop/themes/README.md | 21 +++ .../home/rsydn/desktop/wayland/default.nix | 11 ++ .../desktop/wayland/hyprland/default.nix | 46 ++++++ .../rsydn/desktop/wayland/niri/default.nix | 39 ++++++ modules/nixos/audio.nix | 14 ++ modules/nixos/bluetooth.nix | 13 ++ modules/nixos/desktops/README.md | 34 +++++ modules/nixos/desktops/base.nix | 28 ++++ modules/nixos/desktops/hyprland.nix | 31 ++++ modules/nixos/desktops/niri.nix | 28 ++++ modules/nixos/desktops/plasma.nix | 16 +++ modules/nixos/fonts.nix | 40 ++++++ modules/nixos/graphics.nix | 22 +++ modules/nixos/home/desktop.nix | 24 ++++ modules/nixos/home/gaming.nix | 32 +++++ modules/nixos/hosts/desktop-dev.nix | 42 ++++++ modules/nixos/hosts/gaming-rig.nix | 53 +++++++ 22 files changed, 716 insertions(+), 11 deletions(-) create mode 100644 DESKTOP-SETUP.md create mode 100644 modules/home/rsydn/desktop/apps/browsers.nix create mode 100644 modules/home/rsydn/desktop/apps/terminals.nix create mode 100644 modules/home/rsydn/desktop/base.nix create mode 100644 modules/home/rsydn/desktop/themes/README.md create mode 100644 modules/home/rsydn/desktop/wayland/default.nix create mode 100644 modules/home/rsydn/desktop/wayland/hyprland/default.nix create mode 100644 modules/home/rsydn/desktop/wayland/niri/default.nix create mode 100644 modules/nixos/audio.nix create mode 100644 modules/nixos/bluetooth.nix create mode 100644 modules/nixos/desktops/README.md create mode 100644 modules/nixos/desktops/base.nix create mode 100644 modules/nixos/desktops/hyprland.nix create mode 100644 modules/nixos/desktops/niri.nix create mode 100644 modules/nixos/desktops/plasma.nix create mode 100644 modules/nixos/fonts.nix create mode 100644 modules/nixos/graphics.nix create mode 100644 modules/nixos/home/desktop.nix create mode 100644 modules/nixos/home/gaming.nix create mode 100644 modules/nixos/hosts/desktop-dev.nix create mode 100644 modules/nixos/hosts/gaming-rig.nix diff --git a/AGENTS.md b/AGENTS.md index b8dfdae..5822839 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,23 +1,19 @@ # Repository Guidelines ## Project Structure & Module Organization -This flake manages both macOS (`macbook-pro`) and NixOS (`dev-vm`) hosts. `flake.nix` collects shared modules while `flake.lock` pins inputs. Platform modules live in `modules/darwin/` and `modules/nixos/`; the Linux base `system.nix` pulls in `users.nix`, `network.nix`, `ssh.nix`, and `containerization.nix`. Host overlays such as `modules/nixos/hosts/dev-vm.nix` add virtio tooling or per-machine packages. User-facing configuration sits under `modules/home/rsydn/` with `programs/`, `shell/`, and `devtools/`; Darwin layers `shell/nushell.nix` and Linux sticks to `shell/fish.nix`. Secrets remain encrypted in `secrets/*.sops.yaml` and appear at runtime under `~/.config/secrets/`. +Shared logic lives in `flake.nix`, with inputs pinned in `flake.lock`. Platform modules sit under `modules/darwin/` and `modules/nixos/`; Linux hosts compose `modules/nixos/system.nix` plus `users.nix`, `network.nix`, `ssh.nix`, and `containerization.nix`. Host-specific overlays like `modules/nixos/hosts/dev-vm.nix` supply virtualization packages, while macOS tweaks belong in `modules/darwin/hosts/`. Home Manager layers for `rsydn` are under `modules/home/rsydn/` with `programs/`, `shell/`, and `devtools/`. Secrets stay encrypted in `secrets/*.sops.yaml` and surface at runtime in `~/.config/secrets/`. -## Build, Test & Development Commands -- `nix develop` – enter the dev shell with `git`, `nixfmt-classic`, and SOPS tooling prewired. -- `nix fmt` – format every Nix file; run before committing module or overlay changes. -- `XDG_CACHE_HOME=$PWD/.cache nix flake check` – evaluate all hosts without polluting the global cache. -- `darwin-rebuild --dry-run --flake .#macbook-pro` → `darwin-rebuild switch --flake .#macbook-pro` – preview then apply macOS updates. -- `nix build .#nixosConfigurations.dev-vm.config.system.build.toplevel` – validate the Linux VM closure before switching. +## Build, Test, and Development Commands +Use `nix develop` to enter the project shell with `git`, `nixfmt-classic`, and SOPS ready. Run `nix fmt` before committing to format all Nix sources. `XDG_CACHE_HOME=$PWD/.cache nix flake check` validates every host without polluting the global cache. For macOS changes, run `darwin-rebuild --dry-run --flake .#macbook-pro` and follow with `darwin-rebuild switch --flake .#macbook-pro`. Validate the Linux VM closure via `nix build .#nixosConfigurations.dev-vm.config.system.build.toplevel`. ## Coding Style & Naming Conventions -Use two-space indentation, trailing commas, and lower-kebab filenames (e.g. `shell/nushell.nix`). Declare custom options in the `rsydn.*` namespace and prefer shared modules over ad-hoc host tweaks. +Indent with two spaces and keep trailing commas in attribute sets. Prefer lower-kebab filenames (e.g. `shell/nushell.nix`), and expose custom options under the `rsydn.*` namespace. Format Nix with `nix fmt`; avoid ad-hoc host tweaks when a shared module fits. ## Testing Guidelines -Treat `nix flake check` as mandatory gatekeeping. Capture activation output (`darwin-rebuild --dry-run`, `nix build .#nixosConfigurations.dev-vm…`) and attach summaries to reviews. Co-locate regression tests next to their modules with the `.nix` pattern. +Treat `nix flake check` as the minimum gate; capture its output for reviews. When adjusting host builds, keep dry-run transcripts (`darwin-rebuild --dry-run`, `nix build .#nixosConfigurations.dev-vm…`) to share in PRs. Co-locate regression tests next to their modules using the `.nix` pattern. ## Commit & Pull Request Guidelines -Keep commit subjects short and imperative (`add dev-vm virtualization module`) and scope each commit narrowly. PRs should list validation commands, link issues or TODOs, and include screenshots or terminal snippets when modifying prompts, Tailscale, or SSH flows. +Write imperative commit subjects such as `add dev-vm virtualization module`, and keep each commit narrowly scoped. PRs should list validation commands run, link related issues or TODOs, and attach screenshots or terminal snippets when touching prompts, Tailscale, or SSH flows. ## Security & Configuration Tips -Age keys live at `~/.config/sops/age/keys.txt`; regenerate via Home Manager if missing. Read secrets from the managed files (`open ~/.config/secrets/openai-api-key | str trim`) and scope them with `with-env`. Tailscale and OpenSSH run by default on Linux; rotate keys regularly and audit `services.tailscale.extraUpFlags` before enabling exit nodes. +Age keys live at `~/.config/sops/age/keys.txt`; regenerate via Home Manager if missing. Access secrets with `open ~/.config/secrets/ | str trim` and scope them using `with-env`. Audit `services.tailscale.extraUpFlags` before enabling exit nodes, and rotate SSH/Tailscale keys regularly. diff --git a/DESKTOP-SETUP.md b/DESKTOP-SETUP.md new file mode 100644 index 0000000..3c467e2 --- /dev/null +++ b/DESKTOP-SETUP.md @@ -0,0 +1,132 @@ +# Desktop Setup Guide + +This guide explains how to add desktop configurations to your NixOS system. + +## Architecture + +Desktop configuration is split into 3 layers: + +### Layer 1: Base Infrastructure (`modules/nixos/*.nix`) +Hardware support that all desktops need: +- `audio.nix` - PipeWire audio stack +- `bluetooth.nix` - Bluetooth support +- `graphics.nix` - OpenGL/Vulkan acceleration +- `fonts.nix` - System fonts + +### Layer 2: Desktop Environments (`modules/nixos/desktops/`) +System-level DE/WM configuration: +- `hyprland.nix` - Hyprland compositor +- `plasma.nix` - KDE Plasma 6 +- `niri.nix` - Niri compositor +- `base.nix` - Shared DE settings + +### Layer 3: User Configuration (`modules/home/rsydn/desktop/`) +Home Manager user-level configs: +- `base.nix` - GTK/Qt theming +- `apps/` - GUI application configs +- `wayland/` - Compositor user configs +- `themes/` - Theme configurations + +## Quick Start + +### 1. Update `flake.nix` + +Add a new host configuration: + +```nix +nixosConfigurations.my-desktop = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./modules/nixos/system.nix + ./modules/nixos/hosts/desktop-dev.nix # Your host config + home-manager.nixosModules.home-manager { + home-manager.users.rsydn = import ./modules/nixos/home/desktop.nix; + } + ]; +}; +``` + +### 2. Update `modules/nixos/system.nix` + +Add desktop infrastructure imports: + +```nix +{ lib, ... }: { + imports = [ + ./users.nix + ./network.nix + ./ssh.nix + ./containerization.nix + # Add these for desktop: + ./audio.nix + ./bluetooth.nix + ./graphics.nix + ./fonts.nix + ]; + # ... rest of config +} +``` + +### 3. Customize Host Configuration + +Copy and modify `modules/nixos/hosts/desktop-dev.nix`: +- Set hostname +- Choose desktop environment (import from `desktops/`) +- Add hardware-specific settings (GPU drivers, etc.) + +### 4. Enable Compositor in Home Manager + +Edit `modules/home/rsydn/desktop/wayland/default.nix`: + +```nix +imports = [ + ./hyprland # Uncomment the compositor you want + # ./niri +]; +``` + +### 5. Build and Switch + +```bash +# Check configuration +nix flake check + +# Build +sudo nixos-rebuild switch --flake .#my-desktop +``` + +## Examples + +### Hyprland Development Workstation +1. Host imports `desktops/hyprland.nix` +2. Home Manager imports `desktop/wayland/hyprland` +3. Customize keybinds in `desktop/wayland/hyprland/default.nix` + +### KDE Plasma Gaming Rig +1. Host imports `desktops/plasma.nix` +2. Home Manager imports `desktop/base.nix` only +3. Enable Steam in host config +4. Add gaming packages + +## Ricing Guide + +All customization should happen in Layer 3 (`modules/home/rsydn/desktop/`): + +1. **Themes**: Add theme files in `desktop/themes/` +2. **Compositor styling**: Edit `desktop/wayland/{hyprland,niri}/` +3. **Application configs**: Edit `desktop/apps/` +4. **Keep Layer 1 & 2 minimal** - they provide functionality, not aesthetics + +## Switching Desktop Environments + +Simply change the import in your host config: + +```nix +# Before +imports = [ ../desktops/hyprland.nix ]; + +# After +imports = [ ../desktops/plasma.nix ]; +``` + +Then rebuild your system. diff --git a/modules/home/rsydn/desktop/apps/browsers.nix b/modules/home/rsydn/desktop/apps/browsers.nix new file mode 100644 index 0000000..85003cf --- /dev/null +++ b/modules/home/rsydn/desktop/apps/browsers.nix @@ -0,0 +1,19 @@ +{ pkgs, ... }: +{ + # Browser configurations + home.packages = with pkgs; [ + firefox + # chromium + # brave + ]; + + # Firefox config (expand as needed) + # programs.firefox = { + # enable = true; + # profiles.default = { + # settings = { + # "browser.startup.homepage" = "about:home"; + # }; + # }; + # }; +} diff --git a/modules/home/rsydn/desktop/apps/terminals.nix b/modules/home/rsydn/desktop/apps/terminals.nix new file mode 100644 index 0000000..0703a46 --- /dev/null +++ b/modules/home/rsydn/desktop/apps/terminals.nix @@ -0,0 +1,28 @@ +{ pkgs, lib, ... }: +{ + # Terminal emulators + + # Kitty - GPU-accelerated terminal + programs.kitty = { + enable = lib.mkDefault false; + # theme = "Dracula"; + # settings = { + # font_family = "JetBrains Mono"; + # font_size = 12; + # }; + }; + + # Alacritty - GPU-accelerated terminal + programs.alacritty = { + enable = lib.mkDefault false; + # settings = { + # font.normal.family = "JetBrains Mono"; + # font.size = 12; + # }; + }; + + # WezTerm - GPU-accelerated terminal + # programs.wezterm = { + # enable = false; + # }; +} diff --git a/modules/home/rsydn/desktop/base.nix b/modules/home/rsydn/desktop/base.nix new file mode 100644 index 0000000..83e62b0 --- /dev/null +++ b/modules/home/rsydn/desktop/base.nix @@ -0,0 +1,36 @@ +{ lib, pkgs, config, ... }: +{ + # Base desktop user configuration + + # GTK theming + gtk = { + enable = lib.mkDefault true; + theme = lib.mkDefault { + name = "Adwaita-dark"; + package = pkgs.gnome-themes-extra; + }; + }; + + # Qt theming + qt = { + enable = lib.mkDefault true; + platformTheme.name = lib.mkDefault "gtk"; + style.name = lib.mkDefault "adwaita-dark"; + }; + + # XDG user directories + xdg = { + enable = true; + userDirs = { + enable = true; + createDirectories = true; + }; + }; + + # Basic GUI packages + home.packages = with pkgs; [ + # Add common desktop apps here + # firefox + # vscodium + ]; +} diff --git a/modules/home/rsydn/desktop/themes/README.md b/modules/home/rsydn/desktop/themes/README.md new file mode 100644 index 0000000..6638359 --- /dev/null +++ b/modules/home/rsydn/desktop/themes/README.md @@ -0,0 +1,21 @@ +# Themes + +Add your theme configurations here. Each theme should set: +- GTK theme +- Qt theme +- Terminal colors +- Compositor colors (if applicable) +- Wallpapers + +Example structure: +```nix +# catppuccin.nix +{ pkgs, ... }: { + gtk.theme = { + name = "Catppuccin-Mocha"; + package = pkgs.catppuccin-gtk; + }; + + # ... more theme settings +} +``` diff --git a/modules/home/rsydn/desktop/wayland/default.nix b/modules/home/rsydn/desktop/wayland/default.nix new file mode 100644 index 0000000..8793109 --- /dev/null +++ b/modules/home/rsydn/desktop/wayland/default.nix @@ -0,0 +1,11 @@ +{ ... }: +{ + # Wayland compositor configurations + # Import the compositor you want to use + + imports = [ + # Uncomment the one you want: + # ./hyprland + # ./niri + ]; +} diff --git a/modules/home/rsydn/desktop/wayland/hyprland/default.nix b/modules/home/rsydn/desktop/wayland/hyprland/default.nix new file mode 100644 index 0000000..72edd32 --- /dev/null +++ b/modules/home/rsydn/desktop/wayland/hyprland/default.nix @@ -0,0 +1,46 @@ +{ lib, pkgs, ... }: +{ + # Hyprland user configuration + wayland.windowManager.hyprland = { + enable = lib.mkDefault true; + xwayland.enable = lib.mkDefault true; + + settings = { + # Minimal config - expand as needed + "$mod" = "SUPER"; + + # Example keybinds + bind = [ + "$mod, Return, exec, kitty" # Terminal + "$mod, Q, killactive" + "$mod, M, exit" + "$mod, F, fullscreen" + "$mod, Space, togglefloating" + + # Move focus + "$mod, h, movefocus, l" + "$mod, l, movefocus, r" + "$mod, k, movefocus, u" + "$mod, j, movefocus, d" + ]; + + # Example settings + general = { + gaps_in = 5; + gaps_out = 10; + border_size = 2; + }; + + decoration = { + rounding = 8; + }; + }; + }; + + # Hyprland utilities + home.packages = with pkgs; [ + # wofi # Launcher + # waybar # Status bar + # dunst # Notifications + ]; +} diff --git a/modules/home/rsydn/desktop/wayland/niri/default.nix b/modules/home/rsydn/desktop/wayland/niri/default.nix new file mode 100644 index 0000000..e3909e9 --- /dev/null +++ b/modules/home/rsydn/desktop/wayland/niri/default.nix @@ -0,0 +1,39 @@ +{ lib, pkgs, ... }: +{ + # Niri user configuration + programs.niri = { + settings = { + # Minimal config - expand as needed + input = { + keyboard.xkb = { + layout = "us"; + }; + }; + + # Example keybinds + binds = { + "Mod+Return".action.spawn = [ "kitty" ]; + "Mod+Q".action.close-window = { }; + "Mod+F".action.fullscreen-window = { }; + + # Focus movement + "Mod+H".action.focus-column-left = { }; + "Mod+L".action.focus-column-right = { }; + "Mod+J".action.focus-window-down = { }; + "Mod+K".action.focus-window-up = { }; + }; + + layout = { + gaps = 8; + center-focused-column = "never"; + }; + }; + }; + + # Niri utilities + home.packages = with pkgs; [ + # fuzzel # Launcher (recommended for niri) + # waybar # Status bar + # dunst # Notifications + ]; +} diff --git a/modules/nixos/audio.nix b/modules/nixos/audio.nix new file mode 100644 index 0000000..ad9707e --- /dev/null +++ b/modules/nixos/audio.nix @@ -0,0 +1,14 @@ +{ lib, ... }: +{ + # Modern audio stack - PipeWire replaces PulseAudio + JACK + ALSA + services.pipewire = { + enable = lib.mkDefault true; + alsa.enable = lib.mkDefault true; + alsa.support32Bit = lib.mkDefault true; # For 32-bit games/apps + pulse.enable = lib.mkDefault true; # PulseAudio compatibility + jack.enable = lib.mkDefault true; # JACK compatibility + }; + + # Real-time audio priority + security.rtkit.enable = lib.mkDefault true; +} diff --git a/modules/nixos/bluetooth.nix b/modules/nixos/bluetooth.nix new file mode 100644 index 0000000..cd64072 --- /dev/null +++ b/modules/nixos/bluetooth.nix @@ -0,0 +1,13 @@ +{ lib, ... }: +{ + hardware.bluetooth = { + enable = lib.mkDefault false; # Enable when needed + powerOnBoot = lib.mkDefault true; + settings = { + General = { + Enable = "Source,Sink,Media,Socket"; + Experimental = true; # Better codec support + }; + }; + }; +} diff --git a/modules/nixos/desktops/README.md b/modules/nixos/desktops/README.md new file mode 100644 index 0000000..dc7859a --- /dev/null +++ b/modules/nixos/desktops/README.md @@ -0,0 +1,34 @@ +# Desktop Environments + +This directory contains system-level desktop environment configurations. + +## Available Desktop Environments + +- `hyprland.nix` - Dynamic tiling Wayland compositor +- `plasma.nix` - KDE Plasma 6 desktop environment +- `niri.nix` - Scrollable-tiling Wayland compositor +- `base.nix` - Shared desktop settings (imported by all DEs) + +## Usage + +Import one desktop environment in your host configuration: + +```nix +# modules/nixos/hosts/your-host.nix +{ + imports = [ + ../desktops/hyprland.nix + # OR + # ../desktops/plasma.nix + # OR + # ../desktops/niri.nix + ]; +} +``` + +## Adding a New Desktop Environment + +1. Create a new file (e.g., `gnome.nix`) +2. Import `./base.nix` +3. Enable the desktop environment +4. Add essential system packages diff --git a/modules/nixos/desktops/base.nix b/modules/nixos/desktops/base.nix new file mode 100644 index 0000000..1caf9d6 --- /dev/null +++ b/modules/nixos/desktops/base.nix @@ -0,0 +1,28 @@ +{ lib, pkgs, ... }: +{ + # Shared desktop settings (imported by all DEs) + + # XDG portals for desktop integration + xdg.portal = { + enable = lib.mkDefault true; + extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + }; + + # Policy kit for privilege escalation + security.polkit.enable = lib.mkDefault true; + + # GVFS for trash, mounting, etc + services.gvfs.enable = lib.mkDefault true; + + # Common desktop packages + environment.systemPackages = with pkgs; [ + # File managers (choose one) + # nautilus # GNOME + # dolphin # KDE + # thunar # XFCE + + # Basic utilities + pavucontrol # Audio control + networkmanagerapplet # Network management GUI + ]; +} diff --git a/modules/nixos/desktops/hyprland.nix b/modules/nixos/desktops/hyprland.nix new file mode 100644 index 0000000..f725ed8 --- /dev/null +++ b/modules/nixos/desktops/hyprland.nix @@ -0,0 +1,31 @@ +{ pkgs, lib, ... }: +{ + imports = [ ./base.nix ]; + + # Hyprland - Dynamic tiling Wayland compositor + programs.hyprland = { + enable = lib.mkDefault true; + xwayland.enable = lib.mkDefault true; + }; + + # Wayland-specific portal + xdg.portal.wlr.enable = lib.mkDefault true; + + # Essential Wayland tools (system-level) + environment.systemPackages = with pkgs; [ + # Wayland essentials + wayland + wl-clipboard + wlr-randr + + # Screenshot & screen recording + grim # Screenshot + slurp # Region selector + # wf-recorder # Screen recording (optional) + + # Add your preferred apps here + # kitty # Terminal + # wofi # Launcher + # waybar # Bar + ]; +} diff --git a/modules/nixos/desktops/niri.nix b/modules/nixos/desktops/niri.nix new file mode 100644 index 0000000..da5155b --- /dev/null +++ b/modules/nixos/desktops/niri.nix @@ -0,0 +1,28 @@ +{ pkgs, lib, ... }: +{ + imports = [ ./base.nix ]; + + # Niri - Scrollable-tiling Wayland compositor + programs.niri = { + enable = lib.mkDefault true; + }; + + # Wayland-specific portal + xdg.portal.wlr.enable = lib.mkDefault true; + + # Essential Wayland tools + environment.systemPackages = with pkgs; [ + # Wayland essentials + wayland + wl-clipboard + + # Screenshot tools + grim + slurp + + # Add your preferred apps here + # kitty # Terminal + # fuzzel # Launcher (recommended for niri) + # waybar # Bar + ]; +} diff --git a/modules/nixos/desktops/plasma.nix b/modules/nixos/desktops/plasma.nix new file mode 100644 index 0000000..3c7e150 --- /dev/null +++ b/modules/nixos/desktops/plasma.nix @@ -0,0 +1,16 @@ +{ lib, ... }: +{ + imports = [ ./base.nix ]; + + # KDE Plasma 6 + services.desktopManager.plasma6.enable = lib.mkDefault true; + + # SDDM display manager + services.displayManager.sddm = { + enable = lib.mkDefault true; + wayland.enable = lib.mkDefault true; + }; + + # KDE apps are managed by Plasma + # Add extra packages in your host config if needed +} diff --git a/modules/nixos/fonts.nix b/modules/nixos/fonts.nix new file mode 100644 index 0000000..995940e --- /dev/null +++ b/modules/nixos/fonts.nix @@ -0,0 +1,40 @@ +{ lib, pkgs, ... }: +{ + fonts = { + enableDefaultPackages = lib.mkDefault true; + + packages = with pkgs; [ + # Nerd Fonts for terminal icons + (nerdfonts.override { + fonts = [ + "FiraCode" + "JetBrainsMono" + "Iosevka" + ]; + }) + + # Core fonts + noto-fonts + noto-fonts-cjk + noto-fonts-emoji + liberation_ttf + + # Code fonts + fira-code + jetbrains-mono + ]; + + fontconfig = { + enable = lib.mkDefault true; + defaultFonts = { + monospace = [ + "JetBrains Mono" + "FiraCode Nerd Font" + ]; + sansSerif = [ "Noto Sans" ]; + serif = [ "Noto Serif" ]; + emoji = [ "Noto Color Emoji" ]; + }; + }; + }; +} diff --git a/modules/nixos/graphics.nix b/modules/nixos/graphics.nix new file mode 100644 index 0000000..c696961 --- /dev/null +++ b/modules/nixos/graphics.nix @@ -0,0 +1,22 @@ +{ lib, pkgs, ... }: +{ + # Hardware acceleration (OpenGL/Vulkan) + hardware.graphics = { + enable = lib.mkDefault true; + enable32Bit = lib.mkDefault true; # For 32-bit games/apps + + extraPackages = with pkgs; [ + # Common drivers (expand based on your hardware) + mesa.drivers + vulkan-validation-layers + vulkan-tools + + # Intel-specific (comment out if not using Intel) + intel-media-driver + intel-vaapi-driver + + # AMD-specific (comment out if not using AMD) + # rocmPackages.clr.icd + ]; + }; +} diff --git a/modules/nixos/home/desktop.nix b/modules/nixos/home/desktop.nix new file mode 100644 index 0000000..b3a4d23 --- /dev/null +++ b/modules/nixos/home/desktop.nix @@ -0,0 +1,24 @@ +{ ... }: +{ + # Desktop user configuration (for Hyprland/Niri setups) + + imports = [ + # Base CLI tools + ../../home/rsydn/base.nix + + # Desktop additions + ../../home/rsydn/desktop/base.nix + ../../home/rsydn/desktop/apps/browsers.nix + ../../home/rsydn/desktop/apps/terminals.nix + + # Choose your compositor + ../../home/rsydn/desktop/wayland + # Enable specific compositor in wayland/default.nix + + # Add theme when ready + # ../../home/rsydn/desktop/themes/catppuccin.nix + ]; + + # Override options here + # programs.kitty.enable = true; +} diff --git a/modules/nixos/home/gaming.nix b/modules/nixos/home/gaming.nix new file mode 100644 index 0000000..0201926 --- /dev/null +++ b/modules/nixos/home/gaming.nix @@ -0,0 +1,32 @@ +{ pkgs, ... }: +{ + # Gaming user configuration (for KDE Plasma) + + imports = [ + # Base CLI tools + ../../home/rsydn/base.nix + + # Desktop base + ../../home/rsydn/desktop/base.nix + ../../home/rsydn/desktop/apps/browsers.nix + ]; + + # Gaming-specific user packages + home.packages = with pkgs; [ + # Communication + # discord + # teamspeak_client + + # Streaming/Recording + # obs-studio + + # Media + # spotify + ]; + + # KDE-specific settings (optional) + # programs.plasma = { + # enable = true; + # workspace.theme = "breeze-dark"; + # }; +} diff --git a/modules/nixos/hosts/desktop-dev.nix b/modules/nixos/hosts/desktop-dev.nix new file mode 100644 index 0000000..c612c08 --- /dev/null +++ b/modules/nixos/hosts/desktop-dev.nix @@ -0,0 +1,42 @@ +{ pkgs, ... }: +{ + # Example desktop development workstation configuration + # Copy and modify for your actual hardware + + # Boot configuration (adjust for your system) + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # Hostname + networking.hostName = "desktop-dev"; + + # Import desktop environment (choose one) + imports = [ + ../desktops/hyprland.nix + # ../desktops/plasma.nix + # ../desktops/niri.nix + ]; + + # Hardware-specific settings (adjust for your hardware) + # boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "sd_mod" ]; + + # GPU drivers (uncomment if using NVIDIA) + # services.xserver.videoDrivers = [ "nvidia" ]; + # hardware.nvidia = { + # modesetting.enable = true; + # open = false; # Use proprietary driver + # }; + + # Optional: Enable bluetooth + # hardware.bluetooth.enable = true; + + # Development-specific packages + environment.systemPackages = with pkgs; [ + # Add desktop dev tools here + # docker-compose + # k9s + ]; + + # This value determines the NixOS release compatibility + system.stateVersion = "24.05"; +} diff --git a/modules/nixos/hosts/gaming-rig.nix b/modules/nixos/hosts/gaming-rig.nix new file mode 100644 index 0000000..3ff8034 --- /dev/null +++ b/modules/nixos/hosts/gaming-rig.nix @@ -0,0 +1,53 @@ +{ pkgs, ... }: +{ + # Example gaming desktop configuration + # Copy and modify for your actual hardware + + # Boot configuration + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # Hostname + networking.hostName = "gaming-rig"; + + # Import KDE Plasma for gaming + imports = [ ../desktops/plasma.nix ]; + + # Gaming-specific settings + programs.steam = { + enable = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + }; + + # GameMode for performance optimization + programs.gamemode.enable = true; + + # GPU drivers (example: NVIDIA) + # services.xserver.videoDrivers = [ "nvidia" ]; + # hardware.nvidia = { + # modesetting.enable = true; + # powerManagement.enable = false; + # open = false; + # package = config.boot.kernelPackages.nvidiaPackages.stable; + # }; + + # Gaming packages + environment.systemPackages = with pkgs; [ + # Launchers + lutris + heroic + # bottles + + # Tools + mangohud # FPS overlay + # gamescope # Gaming compositor + # protonup-qt # Proton version manager + + # Communication + discord + ]; + + # This value determines the NixOS release compatibility + system.stateVersion = "24.05"; +}