How rushabhp-droid/nixos-conf works
1. Overall shape
This is a single-host Nix flake that produces a reproducible NixOS system plus a Home Manager user environment. The repository is organized around a clear split between machine-wide configuration and user-session/dotfiles configuration.
2. Entry points
flake.nix is the top-level composition layer. It pulls in inputs, exposes outputs, and wires together the host definition under hosts/laptop/ with shared modules under modules/. treefmt.nix and .pre-commit-config.yaml define the repository’s code-quality boundary.
3. Host layer
hosts/laptop/configuration.nix is the NixOS entry point for the laptop. It combines the hardware declaration (hardware-configuration.nix, disk-config.nix) with the reusable NixOS modules. This is where the system becomes a specific machine profile rather than a generic module set.
4. System-wide subsystems
modules/nixos/ contains the OS-level responsibilities: core system setup, users, security, hardware tweaks, NVIDIA-specific support, fonts, gaming/Steam, auto-refresh, and secret integration. These modules shape boot-time behavior, drivers, services, and privileged configuration.
5. User-session subsystem
hosts/laptop/home/home.nix hands off to modules/home-manager/, which defines the user environment. This layer owns shell, terminal, editor, compositor session config, notification tools, and desktop utilities. It is separate from the OS layer so user preferences can evolve independently of the machine config.
6. Desktop environment stack
The session is Wayland-centric and centered on Hyprland. Supporting pieces include waybar for the panel, rofi for launching, hypridle and hyprlock for session locking/power behavior, plus swaync, swayosd, and wleave for notifications, on-screen display, and logout flow. The raw/ directories hold the actual config assets consumed by those modules.
7. Configuration flow for the desktop
The Hyprland setup is split into Lua fragments under modules/home-manager/desktop/raw/hyprland/ for animation, autostart, colors, general settings, keybinds, and rules. Waybar has separate JSON/CSS assets under raw/waybar/. This indicates a pattern where Nix modules install and parameterize the apps, while raw files define the exact runtime configuration.
8. Theming and visual coherence
modules/home-manager/system/stylix.nix and the README point to Stylix as the global theme engine. Styling is propagated across the OS and desktop apps, with shared colors/fonts feeding Waybar, Rofi, terminal appearance, and other UI elements. This is a cross-cutting concern rather than a single app feature.
9. Shell, terminal, and CLI tools
The CLI side is grouped under modules/home-manager/cli/ and includes alacritty.nix, helix.nix, and zsh.nix. These define the interactive developer environment at the user level, sitting alongside the graphical desktop stack.
10. Secrets boundary
modules/nixos/system/sops.nix and modules/nixos/system/secrets/ handle sensitive data via sops-nix with age-encrypted secrets. The encrypted secrets.yaml is the source of truth; at evaluation/runtime it becomes injected into system services or users without exposing plaintext in the repo.
11. Hardware and platform-specific behavior
The repository includes dedicated hardware tuning modules, especially for NVIDIA/hybrid graphics and power management. That suggests the architecture is intentionally tuned for this laptop’s runtime constraints rather than being a generic desktop template.
12. Operations and maintenance
The repo is designed to be managed through Nix workflows: rebuilds via nh, updates via nix flake update, and formatting/linting via nix fmt plus pre-commit hooks. In diagram terms, the “control plane” is the flake/dev-shell tooling, while the “data plane” is the generated OS and user configuration applied on the machine.
13. What to draw
A useful diagram would show: flake inputs → host config → NixOS modules + Home Manager modules → runtime system services and user apps, with side branches for hardware-specific tuning, secrets injection, and theme propagation through Stylix into the desktop stack.
Main entry points: configuration.nix Laptop host · nixos/default.nix NixOS mods · hyprland.nix Desktop stack · home-manager/default.nix Home modules
Components 34
Composition
Flake entrypoints and repo workflow
- Flake · Top-level Nix flake composing host and shared modules
flake.nix
Laptop host
Machine-specific NixOS and Home Manager wiring
- Laptop host · Machine profile for the laptop system
hosts/laptop/configuration.nix - Disk config · Disk and partition layout for the host
hosts/laptop/disk-config.nix - Hardware cfg · Generated hardware declaration for the laptop
hosts/laptop/hardware-configuration.nix - Home entry · Host-level handoff into the user environment
hosts/laptop/home/home.nix
NixOS layer
System-wide modules and hardware support
- NixOS mods · Shared system modules for the host
modules/nixos/default.nix - Core system · Basic OS setup and shared system defaults
modules/nixos/system/core.nix - Users · User and privilege configuration
modules/nixos/system/users.nix - Security · System security policy and permissions
modules/nixos/system/security.nix - Secrets · Secret injection using encrypted age-backed files
modules/nixos/system/sops.nix - HW tweaks · Laptop-specific hardware tuning and power behavior
modules/nixos/hardware/hardware-tweaks.nix - NVIDIA · Discrete or hybrid graphics support
modules/nixos/hardware/nvidia.nix - Desktop sys · System-wide desktop and session support
modules/nixos/desktop/desktop.nix - Fonts · System font configuration for desktop use
modules/nixos/desktop/fonts.nix - Hyprland sys · System-level support for the Wayland compositor
modules/nixos/desktop/hyprland.nix - Apps · Gaming and Steam-related system packages and settings
modules/nixos/apps/gaming.nix - Steam · Steam integration and runtime support
modules/nixos/apps/steam.nix
Home Manager
User-session modules and desktop stack
- Home modules · Shared user-environment modules
modules/home-manager/default.nix - User core · Base user-session settings and defaults
modules/home-manager/system/core.nix
Desktop runtime
Wayland session components and assets
- Desktop stack · User-level Wayland session applications and controls
modules/home-manager/desktop/hyprland.nix - Hyprland · Main session compositor and input/binding logic
modules/home-manager/desktop/hyprland.nix - Waybar · Status bar and workspace panel
modules/home-manager/desktop/waybar.nix - Rofi · Application launcher and menu entrypoint
modules/home-manager/desktop/rofi.nix - Hypridle · Idle handling, power, and lock behavior
modules/home-manager/desktop/hypridle.nix - Hyprlock · Session lock screen configuration
modules/home-manager/desktop/hyprlock.nix - SwayNC · Notification center and popups
modules/home-manager/desktop/swaync.nix
CLI tools
Shell, terminal, and editor configuration
- CLI stack · Terminal, shell, and editor configuration
modules/home-manager/cli/alacritty.nix - Alacritty · Terminal emulator configuration
modules/home-manager/cli/alacritty.nix - Helix · Modal editor configuration
modules/home-manager/cli/helix.nix - Zsh · Interactive shell configuration
modules/home-manager/cli/zsh.nix
System UI
Shared visual theming and GTK integration
Operations
Secrets and repo maintenance
- Tooling · Formatting and pre-commit workflow for the repository
treefmt.nix - Secret store · Encrypted source of truth for runtime secrets
modules/nixos/system/secrets/secrets.yaml
Connections 37
- Flake → Laptop host: builds host · Flake wires the laptop system as the main NixOS output
- Flake → NixOS mods: imports · Flake composes shared NixOS modules into the system
- Flake → Home modules: imports · Flake composes shared Home Manager modules into the user environment
- Flake → Tooling: dev workflow · Repository formatting and hooks support the flake-based workflow
- Laptop host → Hardware cfg: platform · The host uses generated hardware configuration
- Laptop host → Disk config: storage · The host includes its disk layout definition
- Laptop host → Home entry: hands off · Machine configuration delegates to the user environment
- Laptop host → Core system: uses · Host config assembles the base system module
- Laptop host → Users: uses · Host config includes user and privilege setup
- Laptop host → Security: uses · Host config applies security policy modules
- Laptop host → Secrets: secrets · Host config enables secret injection
- Secrets → Secret store: reads · SOPS decrypts the encrypted secret source
- NixOS mods → Desktop sys: includes · Shared NixOS modules enable the desktop environment
- NixOS mods → Fonts: includes · Shared NixOS modules define system fonts
- NixOS mods → Hyprland sys: includes · Shared NixOS modules support the compositor stack
- NixOS mods → HW tweaks: includes · Shared NixOS modules add hardware tuning
- NixOS mods → NVIDIA: includes · Shared NixOS modules add GPU-specific support
- NixOS mods → Apps: includes · Shared NixOS modules enable application groups
- Apps → Steam: includes · Gaming layer includes Steam support
- Home modules → User core: includes · Home Manager module set starts from the base user config
- Home modules → GTK: includes · User environment bridges GTK theming
- Home modules → Stylix: includes · Home Manager module set propagates global styling
- Home modules → CLI stack: includes · Home Manager module set includes CLI applications
- Home modules → Desktop stack: includes · Home Manager module set includes the desktop session stack
- CLI stack → Alacritty: contains · Terminal configuration is part of the CLI stack
- CLI stack → Helix: contains · Editor configuration is part of the CLI stack
- CLI stack → Zsh: contains · Shell configuration is part of the CLI stack
- Desktop stack → Hyprland: contains · The desktop stack centers on the Hyprland compositor
- Desktop stack → Waybar: contains · The desktop stack includes the panel
- Desktop stack → Rofi: contains · The desktop stack includes application launching
- Desktop stack → Hypridle: contains · The desktop stack handles idle and power behavior
- Desktop stack → Hyprlock: contains · The desktop stack includes locking
- Desktop stack → SwayNC: contains · The desktop stack includes notifications
- Hyprland → Stylix: styled by · Compositor visuals are themed through Stylix
- Waybar → Stylix: styled by · Panel appearance is driven by shared theming
- Rofi → Stylix: styled by · Launcher appearance is driven by shared theming
- GTK → Stylix: bridges · GTK settings translate the shared theme into app appearance