- README.md: streamline Dynu monitor section to concise feature highlight with docs link per user request - README.md: update video recording description to Niri session only (remove Hyprland) - docs/system-maintenance.md: replace legacy desktop build and switch commands with laptop
❄️ Declarative NixOS Workstation & Server Configuration
This repository houses a purely declarative, reproducible NixOS configuration using Nix Flakes and Home Manager. It serves as the single source of truth for provisioning and managing a headless homelab server and high-performance Wayland-native workstation environment on laptop.
🏗️ Repository Architecture
This configuration maintains a strict separation between global system defaults, shared user configuration modules, and host-specific profiles to avoid redundancy.
graph TD
A["flake.nix"] --> B{"Host Targets"}
subgraph Hosts ["Host Profiles (hosts/)"]
S["server<br/><i>(Headless Homelab)</i>"]
L["laptop<br/><i>(Niri Workstation)</i>"]
end
B -->|"server"| S
B -->|"laptop"| L
subgraph Shared ["Shared Modules (modules/)"]
SYS["modules/system/<br/><i>(Base OS & System Daemons)</i>"]
USER["home.nix + modules/user/<br/><i>(User Environment & Apps)</i>"]
end
S --> SYS
L --> SYS
S --> USER
L --> USER
Directory Structure
- flake.nix — Main entry point defining dependencies (inputs) and system host targets (
server,laptop). - home.nix — Global Home Manager declaration defining the user context (
kiskaadee). - hosts/ — Specific hardware configuration files and profiles.
- hosts/server/ — Dedicated headless homelab server configuration:
- configuration.nix — Headless server NixOS config (power-tuned, no GUI, no greeter).
- home.nix — Pure CLI user environment with server diagnostic tools (
htop,iotop,ncdu). - dynu.nix — Service settings triggering Dynu DDNS.
- homeserver.nix — Core services declarative systemd service.
- traefik-deployments.nix — Edge proxy secrets and microservice templates.
- monitor.py — Python script checking for public WAN IP rotations.
- secrets.yaml — Encrypted server credentials.
- hosts/laptop/ — Configuration for the mobile workstation:
- configuration.nix — Main laptop NixOS config.
- home.nix — Niri-based workspace environment settings.
- hosts/server/ — Dedicated headless homelab server configuration:
- modules/ — Reusable, modular system and user configuration files:
- modules/system/ — Global hardware settings, Docker, greetd, and audio:
- base.nix — System-wide terminal base.
- graphical.nix — System display and desktop styling modules.
- modules/user/ — User environment settings:
- base.nix — Core CLI utilities, alias definitions, and fastfetch.
- apps.nix — Packages including Zen Browser, Neovim, and Cloud SDKs.
- terminal.nix — Alacritty terminal emulator, Tmux configurations, and Starship.
- shell/ — Modular, domain-specific shell scripts natively compiled into the shell configuration:
- git.sh — Automation helpers for Git staging, committing, and repositories.
- jump.sh — Interactive navigation helper scripts powered by
fzfandyazi. - pdf.sh — Quick decryption of password-protected PDF files.
- quicklinks.sh — Quick menu launcher for saved bookmarks and workflows.
- todo.sh — Productivity shortcuts and syntax highlighter for
todo.txtandtuxedo. - wayland.sh — Utility to automatically pipe program stdout/stderr to the Wayland clipboard.
- modules/system/ — Global hardware settings, Docker, greetd, and audio:
🛠️ Specialized Shell & Script Automation
1. Smart Dynamic DNS Monitor
- Feature: Smart IP monitor preventing redundant Dynu API calls by verifying WAN IP rotations locally before invoking
ddclient. - Documentation: Detailed flow and operational architecture are documented in the Smart DDNS Updater Guide.
2. GPU-Accelerated Video Recording (record)
- Script Location: modules/user/scripts/record.sh
- Functionality: Uses
wf-recorderto record Wayland outputs in Niri sessions. - Modes:
area— Manually drag and draw a target bounding box usingslurp.window— Target active window or interactively select viaslurp.output— Matches coordinates of the currently active focused monitor (niri msg).screen— Full layout capture.audioflag — Parseswpctlto dynamically resolve output system loopback paths from PipeWire/WirePlumber to include sound.
3. Git Automation Shorthand (git.sh)
- Script Location: modules/user/shell/git.sh
- Features:
gitignore <pattern>— Appends pattern to project-root.gitignore, commits the change, and pushes to remote.gacp <message>— Shorthand to stage all edits, commit with a message, and push directly to the current branch.new-repo <name>— Scaffolds local files, runs git init, and pushes the project to GitHub using theghCLI.
4. Todo.txt & Tuxedo Productivity Helper (todo.sh)
- Script Location: modules/user/shell/todo.sh
- Features:
todo— Launches the interactivetuxedoTUI for the local./todo.txt.todo n/todo next— Displays only the highest-priority focus task.todo n <N>/todo next <N>— Displays the topNpriority tasks (e.g.todo n 3).todo dn/todo do-next— Auto-completes the top priority task._todo_color— Built-in awk parser adding ANSI color formatting for priorities,@contexts,+projects, dates, andkey:valuetags without broken-pipe errors.
5. Repository Bundler Utility (bundle-project)
- Script Location: modules/user/scripts/bundle_project.py
- Features:
bundle-project [target_dir] [-o output_file]— Compresses the structure and contents of a target directory (defaults to.) into a single output file (defaults tooutput.txt).- Natively skips binary files and
.gitrepositories to prevent pollution. - Automatically runs
eza --treeand outputs it as a visual guide at the header of the bundle file.
🔒 Secrets Management (SOPS + age)
No plain text passwords, tokens, or private keys are committed to the public history. Secrets are stored inside encrypted .yaml assets decrypted dynamically on-demand at boot time using sops-nix and SSH host keys.
graph LR
A[Encrypted secrets.yaml in Git] --> B(sops-nix on system boot)
C[Host SSH Private Key /etc/ssh/...] --> B
B --> D[Decrypted RAM filesystem /run/secrets/]
D --> E[Services read secrets securely]
Adding and Modifying Secrets
- Decrypt and open the host secrets file:
nix-shell -p sops --run "sops hosts/server/secrets.yaml" - Save changes and exit.
sopswill automatically re-encrypt the file with the public keys defined in the root .sops.yaml configuration file.
For detailed steps on bootstrapping, key generation, and service decryption, see the Secrets Management Guide.
🚀 Quick Start / Deployment
1. Installation
Clone the configuration workspace directly into your home folder:
git clone https://github.com/kiskaadee/nixos-config.git ~/Config
cd ~/Config
2. Deploy System Configurations
Rebuild and switch to the profile matching your active target host machine:
- Server Host:
sudo nixos-rebuild switch --flake ~/Config#server - Laptop Workstation:
sudo nixos-rebuild switch --flake ~/Config#laptop
Note: The user environment configures nix-switch as an alias to automatically build and switch using the current hostname.
📚 Reference Documentation
- Package & Secrets Workflow Guide — Steps for adding custom applications and managing secrets.
- System Maintenance Guide — Instructions for safe system updates, health checking, and garbage collection.
- Declarative Development Environments — How to use nix-shell, devShells, direnv, and uv for project isolation.
- Secrets Management Details — Secure storage bootstrapping using
sops-nixandage. - Smart DDNS Updater — Under-the-hood details of the smart IP change detector and updater.
- Tmux Terminal Multiplexer — Fast navigation bindings, layouts, and pane splits guide.
- Google Antigravity Setup — Technical instructions for packaging and using the Antigravity agent CLI on NixOS.