Declarative cross-platform system configuration using Nix.
SystemNix manages both macOS (nix-darwin) and NixOS systems through a single, reproducible Nix flake. All system settings, packages, services, and user configurations are defined in code and applied consistently across machines.
| Category | Tools & Services |
|---|---|
| Languages | Go 1.26, Node.js, Bun, Python 3.13, Rust |
| Cloud & Infra | AWS CLI, GCP SDK, kubectl, Helm, Terraform, Docker |
| Development | Git, GitHub CLI, Git Town, JetBrains Toolbox, (editor of choice - NOT VS Code), Fish shell, tmux, Zellij |
| Desktop (NixOS) | Niri (Wayland tiling), Waybar, SDDM, Rofi, Kitty, Dunst, swaylock |
| Self-Hosted Services | Immich (photos), Gitea (Git), SigNoz (observability), Homepage Dashboard, PhotoMap AI |
| AI/ML | Ollama (ROCm), Unsloth Studio, llama.cpp, AMD NPU (XDNA) driver |
| Security | Gitleaks, sops-nix, AppArmor, Fail2ban, ClamAV, Touch ID for sudo (macOS) |
| Monitoring | ActivityWatch, Netdata, service health checks |
| Networking | Caddy reverse proxy (TLS), Unbound DNS with 2.5M+ blocked domains, DNSSEC |
| Storage | BTRFS with Timeshift snapshots, ZRAM swap, weekly scrub |
- macOS (Apple Silicon) or Linux (x86_64) with Nix installed
- Administrative access
# Install Nix (Determinate Systems installer)
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
# Clone and apply configuration
git clone https://github.com/LarsArtmann/SystemNix.git ~/projects/SystemNix
cd ~/projects/SystemNix
just setup # Complete setup
just switch # Apply configuration| System | Hardware | Configuration | Command |
|---|---|---|---|
| macOS (Lars-MacBook-Air) | Apple Silicon | flake.nix#Lars-MacBook-Air |
just switch |
| NixOS (evo-x2) | AMD Ryzen AI Max+ 395, 128GB | flake.nix#evo-x2 |
just switch |
SystemNix/
βββ flake.nix # Main entry point with flake-parts
βββ justfile # Task runner for all operations
βββ modules/nixos/services/ # NixOS service modules (Caddy, Gitea, Immich, ...)
βββ pkgs/ # Custom Nix packages (dnsblockd, emeet-pixyd, modernize, jscpd, monitor365, ...)
βββ platforms/
β βββ common/ # Shared across platforms (~80% of config)
β β βββ home-base.nix # Home Manager base (14 program modules)
β β βββ programs/ # Fish, Zsh, Bash, Nushell, Starship, Git, tmux, ...
β β βββ packages/ # Cross-platform packages & fonts
β β βββ core/ # Nix daemon settings
β βββ darwin/ # macOS-specific (nix-darwin)
β β βββ default.nix # System config
β β βββ home.nix # User config
β β βββ services/ # LaunchAgents (ActivityWatch, Crush updates)
β β βββ programs/ # Chrome policies, shell aliases
β βββ nixos/ # NixOS-specific
β βββ system/ # Boot, networking, BTRFS snapshots, DNS blocker
β βββ desktop/ # Niri, Waybar, SDDM, AI stack, security hardening
β βββ hardware/ # AMD GPU/NPU, Bluetooth, hardware config
β βββ programs/ # Rofi, swaylock, wlogout, Yazi, Zellij, Chromium
β βββ users/ # Home Manager user config
βββ scripts/ # Operational scripts (30+)
βββ docs/ # Architecture decisions, status reports, troubleshooting
All services are defined as flake-parts modules and reverse-proxied through Caddy with TLS:
| Service | Port | URL | Description |
|---|---|---|---|
| Caddy | 443 | *.home.lan |
Reverse proxy with sops-managed TLS certs |
| Immich | 2283 | immich.home.lan |
Self-hosted Google Photos alternative (PostgreSQL + Redis + ML) |
| Gitea | 3000 | gitea.home.lan |
Self-hosted Git with GitHub mirror sync |
| SigNoz | 4317, 4318, 8080 | signoz.home.lan |
Observability: traces, metrics, logs + node_exporter + cAdvisor |
| Homepage | 8082 | dash.home.lan |
Service overview dashboard |
| PhotoMap AI | 8050 | photomap.home.lan |
AI-powered photo exploration with UMAP embeddings |
| Authelia | 9091 | auth.home.lan |
SSO/IDP with OIDC, TOTP, WebAuthn 2FA |
| Hermes | β | β | AI agent gateway (Discord bot, cron scheduler, multi-provider LLM) |
| Twenty CRM | 3200 | crm.home.lan |
Self-hosted CRM (Docker Compose: PostgreSQL + Redis) |
| ComfyUI | 8188 | comfyui.home.lan |
AI image generation with ROCm GPU acceleration |
| Voice Agents | 7880 | β | AI voice agent platform (Docker: LiveKit + pipecat) |
| TaskChampion | 10222 | tasks.home.lan |
Taskwarrior sync server (cross-platform + Android) |
| DNS Blocker | 53, 9090 | β | Unbound + dnsblockd, 25 blocklists, DNS-over-TLS upstream |
- 2.5M+ blocked domains (ads, trackers, malware, telemetry, gambling)
- Upstream: Quad9 (DNS-over-TLS) + Cloudflare fallback
- Local
.home.lanDNS records for all services - DNSSEC enabled
- DNS failover: Raspberry Pi 3 secondary resolver with VRRP VIP (planned)
- Niri: Scrollable-tiling Wayland compositor with 5 named workspaces
- Waybar: Custom status bar with workspaces, media, weather, DNS stats, power menu
- SDDM: Login manager with Catppuccin Mocha theme
- Theme: Catppuccin Mocha across all applications (GTK, Qt, terminal, browser)
- Backup WM: Sway configured as fallback
- Session restore: Automatic window/workspace recovery after crash or reboot (systemd timer + niri IPC)
| Component | Configuration |
|---|---|
| CPU | AMD Ryzen AI Max+ 395 (Strix Halo), amd_pstate=guided |
| GPU | AMD integrated (amdgpu), Mesa latest, ROCm compute stack |
| NPU | AMD XDNA via nix-amd-npu, XRT runtime |
| Memory | 128GB unified, ZRAM swap (32GB), tuned for AI/ML workloads |
| Storage | BTRFS root (zstd) + /data (zstd:3), Timeshift snapshots |
| Boot | systemd-boot (50 generations), latest Linux kernel |
| Network | Realtek 2.5G Ethernet, MediaTek WiFi |
# Core workflow
just setup # Initial setup (run once after clone)
just switch # Apply configuration changes
just update # Update flake inputs and packages
just test # Validate configuration (full build)
just test-fast # Syntax-only validation (fast)
# Development
just dev # Format, lint, test
just format # Format code with treefmt + alejandra
just health # System health check
just validate # Nix flake validation
# Maintenance
just clean # Comprehensive cleanup (caches, old packages)
just backup # Backup configuration
just rollback # Revert to previous generation
just check # Check for outdated packages
# Go development
just go-dev # Full Go workflow (format, lint, test, build)
just go-tools-version # Show all Go tool versions
# NixOS services
just dns-diagnostics # Full DNS diagnostics
just immich-status # Check Immich service status
just immich-backup # Run database backup
just gitea-sync-repos # Sync GitHub repos to Gitea
just hermes-status # Check Hermes gateway status
just session-status # Check niri session save state
just cam-status # Check EMEET PIXY webcam state
# Taskwarrior
just task-list # Show pending tasks
just task-sync # Sync with TaskChampion server
just task-backup # Export all tasks as JSONShared across macOS and NixOS via platforms/common/programs/:
| Program | Configuration |
|---|---|
| Fish | Primary shell, shared aliases, carapace completions, 5000 history |
| Zsh | Secondary shell with autosuggestions, syntax highlighting |
| Starship | Prompt with Catppuccin Mocha, performance-optimized |
| Git | GPG signing, SSH insteadOf HTTPS, git-town integration |
| tmux | Catppuccin theme, resurrect plugin, SystemNix dev session |
| FZF | Ripgrep integration, reverse layout |
| KeePassXC | Browser integration (Chromium + Helium) |
| Chromium | Enterprise policies, YouTube Shorts Blocker, HTTPS-only |
| Input | Purpose |
|---|---|
nixpkgs |
Package collection (unstable) |
nix-darwin |
macOS system management |
home-manager |
Cross-platform user configuration |
flake-parts |
Modular flake architecture |
niri |
Scrollable-tiling Wayland compositor |
nix-homebrew |
Declarative Homebrew management (macOS) |
sops-nix |
Secrets management with age encryption |
nix-amd-npu |
AMD NPU (XDNA) driver |
nix-ssh-config |
Shared SSH configuration |
crush-config |
AI assistant configuration |
hermes-agent |
AI agent gateway (Discord bot) |
nix-colors |
Declarative color schemes |
silent-sddm |
SDDM theme with Catppuccin support |
signoz-src |
SigNoz observability source (built from source) |
nur |
Nix User Repository |
GitHub Actions workflow (.github/workflows/nix-check.yml):
- Flake check:
nix flake checkon macOS and Ubuntu - Build: Full Darwin build on macOS runner
- Syntax check:
nix flake check --no-buildon Ubuntu
8 hooks configured via .pre-commit-config.yaml:
- gitleaks β secret detection
- alejandra β Nix formatting
- deadnix β dead code detection
- statix β Nix anti-patterns
- trailing-whitespace β whitespace cleanup
- nix-check β flake validation
- flake-lock-validate β lock file integrity
- check-merge-conflicts β conflict marker detection
| Guide | Description |
|---|---|
| AGENTS.md | AI assistant guide and project conventions |
| Architecture Decisions | ADRs for key design choices |
| Project Status | Development milestones |
| Troubleshooting | Common issues and solutions |
| Architecture Diagrams | Mermaid diagram collection |
just test-fast # Quick syntax validation
just clean && just switch # Clean and rebuildnix profile add nixpkgs#gnupg
# Path: ~/.nix-profile/bin/gpgnix search nixpkgs <package-name>just dns-diagnostics # Full DNS diagnostics
just dns-restart # Restart DNS services
just dns-test # Test resolution and blocking- Make changes in
platforms/common/for cross-platform config - Use platform-specific directories for platform differences
- Run
just testbefore committing - Follow existing code style (2-space indentation for Nix)
Personal configuration. Adapt for your own use.