- Remove headless server configuration, homelab services, and legacy host directories (`hosts/server/`, `hosts/laptop/`). - Consolidate privileged system files into a clean `system/` directory (`core.nix`, `hardware.nix`, `desktop.nix`). - Migrate Home Manager configuration into functional domain modules under `home/` (`desktop.nix`, `dev.nix`, `shell.nix`). - Update `flake.nix` to expose a single `laptop` target. - Overhaul documentation (`architecture.md`, `AGENTS.md`, `README.md`) to reflect the standalone architecture and homelab decoupling. This refactor eliminates the multi-host maintenance tax by decoupling server infrastructure into the Core repository and simplifying workstation management around domain-driven cohesion.
❄️ Declarative NixOS Laptop Workstation 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 high-performance, Wayland-native mobile workstation environment on laptop powered by the Niri scrollable window manager and DankMaterialShell.
Homelab infrastructure and server services are maintained independently in the Core repository.
🏗️ Repository Architecture
The repository enforces a clear separation between privileged system declarations (system/) and unprivileged user-space dotfiles and toolchains (home/), organized by functional domains.
graph TD
A["flake.nix"] --> B["nixosConfigurations.laptop"]
subgraph System ["Privileged System Layer (system/)"]
S_CORE["core.nix<br/><i>(Base OS, Users, Boot, Nix-LD)</i>"]
S_HW["hardware.nix<br/><i>(Power, PipeWire, Bluetooth, Printing)</i>"]
S_DESK["desktop.nix<br/><i>(Niri, DMS Daemon, Greeter, Fonts)</i>"]
end
subgraph User ["Unprivileged User Layer (home/)"]
U_DESK["desktop.nix<br/><i>(GUI Apps, Wayland Tools, Alacritty, Zed)</i>"]
U_DEV["dev.nix<br/><i>(Neovim, Compilers, LSPs, Antigravity)</i>"]
U_SH["shell.nix<br/><i>(Bash, Git, Delta, Tmux, Starship)</i>"]
end
B --> System
B --> User
Directory Structure
- flake.nix — Main entry point defining dependencies (inputs) and system host target (
laptop). - system/ — Privileged NixOS system-level configuration modules:
- default.nix — System composition entrypoint.
- hardware-configuration.nix — Generated hardware scan (disks, CPU microcode, kernel modules).
- core.nix — Base operating system, bootloader, networking, user account, and
nix-ld. - hardware.nix — Power management (
power-profiles-daemon,upower), audio (pipewire), printing/scanning, and Docker. - desktop.nix — Niri compositor enablement, DankMaterialShell daemon, greetd login, and fonts.
- home/ — Home Manager user-space configuration modules (
kiskaadee):- default.nix — User environment entrypoint, state version, and session search paths.
- desktop.nix — Graphical applications (Zen Browser, Zed, media), Wayland capture tools, Alacritty, and Niri/Zed dotfiles.
- dev.nix — Neovim editor setup, developer toolchains (Rust, Python, Node, LSPs), Antigravity CLI, and dev utilities.
- shell.nix — Interactive Bash shell, Git/Delta configuration, SSH client profiles, Tmux, Starship, and Fastfetch.
- config/ — Static dotfile source trees (Alacritty, Fastfetch, Niri, Neovim, Zed, Starship, Tmux).
- scripts/ — Compiled standalone user scripts (
bundle_project.py,record.sh). - shell/ — Modular Bash helper scripts sourced into
.bashrc.
- docs/ — Maintenance runbooks and operational workflows.
🛠️ Specialized Shell & Script Automation
1. GPU-Accelerated Video Recording (record)
- Script Location: home/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.
2. Git Automation Shorthand (git.sh)
- Script Location: home/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.
3. Todo.txt & Tuxedo Productivity Helper (todo.sh)
- Script Location: home/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.
4. Repository Bundler Utility (bundle-project)
- Script Location: home/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)
Sensitive credentials (tokens, private keys) are managed using sops and age. Plaintext secrets are never committed to version control.
For bootstrapping, key generation, and decryption workflows, consult the Secrets Management Guide.
🚀 Quick Start / Deployment
1. Installation
Clone the configuration repository into your home folder:
git clone https://github.com/kiskaadee/nixos-config.git ~/Config
cd ~/Config
2. Validate & Test Build
Verify flake evaluation and dry-build the derivation without switching:
nix flake check
nix build .#nixosConfigurations.laptop.config.system.build.toplevel --no-link
3. Apply Configuration
Switch to the new generation on the laptop:
sudo nixos-rebuild switch --flake ~/Config#laptop
Tip: The shell environment includes the nix-switch alias to automatically rebuild using the local 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. - 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.