Skip to content

Latest commit

ย 

History

3,656 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

-= INFO =-

  • This repo is for rapid prototyping and wild tests!
  • Feel free to copy code, take inspiration, but review before push into prod!

TLDR;

  • Your entire company as a service!
  • Server, services, cloud, client, and network โ€” managed through a single NixOS configuration repo.
  • 532+ NixOS modules across 40+ service categories.
  • Stateless root, declarative deployments, secrets via agenix
  • Cloud SSO via PassKey, YubiKey/Smardcard Tickets and Signatures `

๐Ÿค– **This Document is (co-) generated by AI **

  • The docs are written by CrushAI (me).
  • The code? That's strictly human only!

โœจ What Is This, Exactly

Welcome to a fully declarative, stateless, cloud infrastructure empire โ€” all described idempotently in Nix, all reproducible on demand, all version-controlled to within an inch of its life.

Yes, this is a single git repo that controls:

  • 2 server profiles (srv, srv2) with stateless+LUKS root, home-manager, SOPS/agenix secrets, and a feature-flag-style catalog of 100+ enabled/disabled services
  • 1 full-spectrum build (srv-full) that compiles every service (commented-out = disabled, uncomment to ship)
  • 3 desktop/workstation profiles (kiosk โ€” stateless + no encryption, internet โ€” stateless + LUKS) with full GNOME, AI, and AV package sets
  • OpenWRT router configs, ESP32 guard nodes, IoT device profiles (EcoFlow, Moode, Tibber, HomeAssistant), and network infrastructure

The numbers, for the TL;DR addicts:

Metric Count
Total .nix files 532
Service .nix modules (server/) 355
Service categories 40+
Encrypted secrets (.age) 52
Home Manager configs 2 users (me, mpaepcke)
Host profiles 5
Storage layouts 6+ (stateless, stateless-luks, ZFS, ISO installer variants)
Git mirror mirrors 4 flakes mirrored locally (nixpkgs, agenix, disko, home-manager)
Subdirectory READMEs 13 (one per major directory)

No Kubernetes. No Helm. No Terraform. Just Nix. That's the aesthetic.


๐Ÿ—๏ธ Architecture

Think of it as three layers, stacked like a really secure lasagna:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  flake.nix           โ† Entry point. Defines everything. โ”‚
โ”‚                        Your single pane of god-like INF.โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  configuration.nix     โ† Global defaults (Nix, boot,    โ”‚
โ”‚  siteconfig/config.nix   security, networking, users).  โ”‚
โ”‚  hardware/             โ† Hardware-specific modules.     โ”‚
โ”‚  storage/              โ† Disk layouts via disko.        โ”‚
โ”‚  modules/              โ† Custom modules (hardening,     โ”‚
โ”‚                         SOPS/agenix, logging).          โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  hosts/                โ† Per-host overrides.            โ”‚
โ”‚  role/                 โ† Role profiles (adm, server).   โ”‚
โ”‚  person/               โ† Per-person configs (mpaepcke). โ”‚
โ”‚  user/                 โ† Home Manager (me, desktop/).   โ”‚
โ”‚  packages/             โ† Package sets (base, devops,    โ”‚
โ”‚                         desktop/).                      โ”‚
โ”‚  server/               โ† 355 service modules by cat.    โ”‚
โ”‚  client/               โ† WireGuard, caches, backup,     โ”‚
โ”‚                         RootCA.                         โ”‚
โ”‚  iot/ openwrt/ guard/  โ† IoT, routers, ESP32 guards.    โ”‚
โ”‚  shared/ doc/          โ† Branding, YARA rules, docs.    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Each service is a self-contained NixOS module. Import into a profile's modules list in flake.nix to activate. Disabled services remain visible as a feature catalog โ€” like a Spotify playlist where some tracks are muted but still in the queue.


๐Ÿ“‚ Directory Layout

Each directory has its own README โ€” click through for deep dives:

Directory Purpose Read More
admin/ ๐Ÿ”‘ Makefiles, keygen scripts & admin tooling โ†’
.attic/ ๐Ÿ—„๏ธ Archive of deprecated configs & flake.lock snapshots โ†’
client/ ๐Ÿ–ฅ๏ธ WireGuard, backup clients, firewalls, RootCA setup โ†’
doc/ ๐Ÿ“ Documentation, skills, theme factory, todo lists โ†’
guard/ ๐Ÿ›ก๏ธ Hardened OpenWRT guard nodes + ESP32 mesh gateways โ†’
hardware/ ๐Ÿ”Œ CPU/GPU/device profiles (MacBook, ThinkPad, HP, Intel, AMD) โ†’
hosts/ ๐Ÿ  Per-server NixOS configs (srv, srv2) โ†’
iot/ ๐Ÿ  Smart devices (EcoFlow, HomeAssistant, Tibber, Moode, DAB) โ†’
modules/ ๐Ÿ” Hardening profiles, SOPS/agenix, logging pipeline โ†’
openwrt/ ๐Ÿ“ก OpenWRT firmware builder (GL-inet, D-Link, Pi) โ†’
packages/ ๐Ÿ“ฆ Package sets: base, devops, desktop, AI, wine โ†’
person/ ๐Ÿ‘ค Per-user configs & smartcard SSH keys โ†’
role/ ๐ŸŽญ Role definitions (admin, server baselines) โ†’
server/ โšก 355 service modules across 40+ categories โ†’
shared/ ๐Ÿ“ฆ Branding assets, YARA rules, repo scripts, bookmarks โ†’
siteconfig/ โš™๏ธ Central infra config (IDs, domains, networks, aliases) โ†’
storage/ ๐Ÿ’พ Disk layouts (ZFS, disko), backup, ZFS runbooks โ†’
user/ ๐Ÿ‘ค Home Manager: shell, browsers, desktop, dotfiles โ†’

๐ŸŽฏ Profiles (Your Flavors of Chaos)

Profile Build Target Stack Notes
srv TARGET=srv Full server โ€” admin + server roles, stateless+LUKS, 100+ services (commented = disabled)
srv2 TARGET=srv2 Secondary server with alternate storage (stateless+LUKS sequence) + devops-core + GNOME
srv-full TARGET=srv-full Everything enabled โ€” the golden build. Uncomment to ship. Used for full builds and validation.
kiosk TARGET=kiosk Kiosk desktop, stateless root, no encryption, GNOME + AI packages
internet TARGET=internet Internet desktop, stateless+LUKS, GNOME + browser profile

Build for any target: TARGET=<name> make build. The default auto-detects from /run/current-system/sw/bin/hostname.


๐Ÿš€ Services (The Good Stuff)

355 service modules. 40+ categories. 52 encrypted secrets. Zero terraform-required.

Core Infrastructure

Category Modules Services
dns/ 3 Bind (primary DNS), Blocky (ad-blocking resolver), Unbound (stub resolver), DNSCrypt, AdGuard (DNS-level ad blocking)
iam/ 2 Authelia (OIDC/JWT SSO with PassKey), LLDAP (LDAP/SCIM directory)
pki/ 4 Small-step CA, Certwarden, Mkcertweb, vaultls โ€” full PKI lifecycle from cert auth to auto-renewal
ntp/ 1 Chrony (time sync)
sip/ 1 Coturn (STUN/TURN for VoIP/WebRTC)

Mail & Communication

Category Modules Services
mail/ 9 Maddy (MTA), Stalwart (Rust-based mail suite), Roundcube (webmail), Davis (ticketing), Bichon, open-web-calendar, autoconfig (IMAP/SMTP)
message/ 3 Element Web (Matrix client), NTFY (pub/sub notifications), Tuwunel
rss/ 1 Miniflux (RSS reader with Authelia)

Monitoring & Security

Category Modules Services
monitoring/ 10 Prometheus, Grafana (2 instances), Loki (logs), Kuma (logs UI), Syslog-ng, Wazuh endpoint detection, prometheus-exporter, prometheus-opnsense, speed test
soc/ 5 Chef (SOC orchestration), NetAlertX, Wazuh (SIEM), Web-check, proxy
vpn/ 3 Netbird (mesh VPN), Wg-Access-Server, Wg-Easy (WireGuard)
bastion/ 2 RDP gateways for admin and user access

Data & Storage

Category Modules Services
db/ 6 MySQL, MongoDB, NocoBase (no-code DB), UniD/UNDB (database), Memcached, DatabaseMent
share/ 14 Nextcloud (2 variants), OpenCloud, OwnCloud, Paperless/Paperless-ngx, Picoshare, Shifter, Send/Pingvin/Send (file drops), Yopass (secret sharing), Zipline, Dumbdrop, Smbgate
storage/ 1 ZDash (ZFS dashboard)
cache/ 1 NCPS (Nix binary cache server)

AI & Intelligence

Category Modules Services
ai/ 5 Ollama (local LLM runtime), Open Web UI (2 variants), Crush (the AI that wrote this README โ€” yes, really), translate-llm

OCR, Search & Document Processing

Category Modules Services
ocr/ 3 Paperless-ngx (document management), Paperless-ai (LLM-powered OCR), Stirling
search/ 2 SearXNG (privacy search engine), WebSurfX

Business Apps

Category Modules Services
office/ 5 OnlyOffice (4 variants: container and non), Bentopdf (PDF generation)
crm/ 1 CRM system
erp/ 1 ERPNext
hr/ 2 TimeOff, Urlaub (time-off management)
ticket/ 1 Zammad (helpdesk/ticketing)
time/ 5 Kimai (3 variants: container, LDAP, container+LDAP), TimeTrack (2)
tasks/ 1 DoneTick (task management)
todo 2 DoneTick, Vikunja (task app with Authelia)

Virtualization & Remote Access

Category Modules Services
virtual/ 1 Proxmox (hypervisor)
remote/ 1 Guacamole (HTML5 RDP/VNC gateway)

Media & Content

Category Modules Services
media/ 2 Jellyfin (media server, Authelia-protected), Immich (2 โ€” photo backup + Authelia variant)
portal/ 3 Homer (static dashboard), Glance (aggregated feed dashboard), Homer (home container)
cdn/ 1 WordPress CDN

DevOps & Dev Tools

Category Modules Services
devops/ 5 Atuin (shell history search), N8n (workflow automation), OliveTin (UI for shell commands), OpenVSCode Server, OnCall (scheduling)
infra/ 5 Git mirror (local flake mirror runner), Git mirror container, Git mirror updater, NCPS, Syslog-ng
opnborg/ 5 OpenBorg (distributed build system)
webapp/ 2 res (production), test (testing)

Smart Home & IoT

Category Modules Services
iot/ 5 EcoFlow (power station API integrations โ€” email, access key, secret key, devices), HomeAssistant, Moode (audio), Tibber (smart energy), DAB
lora/ 1 Meshtastic-Web (LoRa mesh networking dashboard)

Translation & Libraries

Category Modules Services
translate/ 1 LibreTranslate (self-hosted translation API)
lang/ 1 LibreTranslate

Wikis, Bookmarking & Extras

Category Modules Services
wiki/ 4 DocMost (Docker), MediaWiki + LDAP variant
bookmarks/ 1 Readeck (read-it-later / bookmark manager)
win/ 2 Windows update/start helpers
nixos/ 1 NixOS-specific configuration module
server/ 1 WebDAV server
network/ 2 Networking toolbox, UniFi controller
it/ 3 Networking toolbox, Rackula, Web-check

Feature Flag Catalog

Services in srv-full that are commented out (#) are declared but disabled โ€” like a menu at a restaurant where you can order anything, but the kitchen only preps what's unblocked. Uncomment to enable. This catalog is intentional visibility, not cleanup debt.


๐Ÿ’ป Development Workflow

make switch            # Build + deploy to your current host (auto-detects hostname)
make boot              # Build + reboot (same as switch, reboots after deploy)
make build             # Build only โ€” no deploy. Inspect first.
make check             # Type-check + dry-run (also runs alejandra formatter)
make rollback          # Switch to the previous generation. Undo button.
make gc                # Garbage collect generations older than 12 days
make clean             # GC old profiles + rebuild from scratch
make world             # Update flake.lock + full build + switch + GC (one command)
make sdb               # Build a NixOS install image for /dev/sdb
make clean-profiles    # Nuke all boot profiles and rebuild
make pre-commit        # Run alejandra + git add your changes
# Direct nixos-rebuild (when you don't want to trust Make's good intentions)
nixos-rebuild switch --flake .#srv
nixos-rebuild boot --flake .#srv
nix flake check        # Run all flake checks
nix flake update       # Update flake.lock from upstream mirrors

# Formatting (alejandra is the only formatter โ€” it's the law)
alejandra --quiet .

Target a different profile: TARGET=kiosk make build


๐Ÿ” Secrets & Authentication

52 encrypted secrets. All managed via agenix. All derived from hardware keys. No plaintext passwords in git. Ever.

Mechanism Implementation
Encryption .age files via age encryption (XChaCha20-Poly1305)
Key derivation YubiKey via age-plugin-yubikey โ€” your hardware key IS your decryption key
Smartcard also supported as a key source
Location modules/resources/*.age โ€” one file per service (e.g. vaultwarden.age, bind.age)
SSH host keys Persisted at /nix/persist/etc/ssh/ (survives root rebuilds)
Authelia SSO OIDC + HMAC + session + JWT + storage keys โ€” PassKey based cloud SSO

Golden rule: Never edit .age files directly. Use paper-age or the agenix decryption process. Messing with them raw is like opening a sealed envelope and wondering why the wax is melted.


๐Ÿง  Design Philosophy (The "Why We're Like This" Section)

Principle What It Means (No Jargon)
Stateless root / is tmpfs. Reboot = fresh OS. Persistent data lives under /nix/persist.
Declarative What you describe is what you get. Period. No apt-get install in runbooks.
Modular 40+ service modules, independently importable, independently breakable.
Secrets locked down YubiKey + agenix. If you don't have your hardware key, you don't have your secrets.
Offline-first All upstream flakes are mirrored locally (git-mirror.home.corp). Air-gapped builds supported.
Feature flags srv-full lists everything. Enabled = uncommented. Disabled = commented. Visibility without noise.
One formatter alejandra. Only one. No debates. The code either formats right or it doesn't get merged.
Progressive disclosure See what's possible (commented services) without seeing what's active. Like a menu with dietary tags.
No Kubernetes This is NixOS. We don't do orchestration. We do declarative system configuration. Different problems, different tools.

๐Ÿ”ฎ System Overview (ASCII, Because Old School)

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  flake.nix  โ”‚โ”€โ”€โ”€โ”€โ”€โ”€>โ”‚ config.nix    โ”‚โ”€โ”€โ”€โ”€โ”€โ”€>  โ”‚  profiles        โ”‚
โ”‚   (entry)    โ”‚      โ”‚ (site config) โ”‚         โ”‚  srv, srv2,      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜         โ”‚  kiosk, internet โ”‚
        โ”‚                                       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ”‚           โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”               โ”‚
        โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€>  โ”‚  modules/     โ”‚               โ”‚
        โ”‚           โ”‚  hardening,   โ”‚               โ”‚
        โ”‚           โ”‚  SOPS/agenix, โ”‚               โ”‚
        โ”‚           โ”‚  logging      โ”‚               โ”‚
        โ”‚           โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜               โ”‚
        โ”‚                                           โ”‚
        โ”‚     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                     โ”‚
        โ””โ”€โ”€โ”€โ”€>โ”‚  server/      โ”‚ <โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
              โ”‚  355 services โ”‚
              โ”‚  40+ cat.     โ”‚
              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“– Documentation Hub

Directory Readmes (click through for deep dives)

Directory Topics Covered
admin/ Makefile targets, key generation scripts, admin tooling
.attic/ Archive of retired configs, flake.lock snapshots, legacy modules
client/ WireGuard, backup, caching, OpenSnitch firewall, YubiLock
doc/ ZFS notes, ESP32 how-tos, Crush skills, theme factory
guard/ Hardened OpenWRT gateways, ESP32 mesh, secure remote access
hardware/ MacBook, ThinkPad, HP, AMD/Intel GPU profiles
hosts/ Per-server NixOS configs (srv, srv2)
iot/ EcoFlow, HomeAssistant, Tibber, Moode audio, DAB radio
modules/ Hardening profiles, agenix, logging pipeline
openwrt/ OpenWRT firmware build system (GL-inet, D-Link, Pi)
packages/ Package sets: base, devops, desktop, AI, wine
person/ Per-user configs & smartcard SSH keys
role/ Role definitions (admin, server baselines)
server/ 355 service modules across 40+ categories
shared/ Branding assets, YARA rules, repo scripts, bookmarks
siteconfig/ Central infra config (IDs, domains, networks, aliases)
storage/ Disk layouts (ZFS, disko), backup, ZFS runbooks
user/ Home Manager: shell, browsers, desktop, dotfiles

Storage Runbooks

Topic Link
ZFS pool management ZFS.md
Backup & restore workflows BACKUP.md

About

nixos flakes

Resources

Stars

10 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages