SkillAgentSearch skills...

Dot.nix

Nix config for Homelab and PCs

Install / Use

/learn @TophC7/Dot.nix

README

<h1><img src="public/nix.svg" height=30 /> dot.nix</h1>

My NixOS & Home Manager Multi User/Host Configuration A modular Nix flake managing multiple systems and users with a focus on reproducibility and ease of maintenance.

Ask DeepWiki

Screenshot with of Rune Host, Blue sands wallpaper Screenshot with of Rune Host, Blue sands wallpaper and some open windows Screenshot with Invincible wallpaper Screenshot with Gojo wallpaper Screenshot with Soraka wallpaper

Architecture Overview

This repository is a host-focused NixOS configuration that manages system and user environments across multiple machines. It uses flake.parts for modularity and delegates packages, overlays, and custom library utilities to my library mix.nix for clean separation of concerns. See mix.nix Integration for more on that.

dot.nix/
├── flake.nix                       # Central entry using flake.parts
├── devshell.nix                    # Development shell configuration
├── CLAUDE.md                       # Claude Code integration & dev instructions
├── .mcp.json                       # Model Context Protocol server config
├── hosts/                          # NixOS system configurations (flat structure)
│   ├── rune/
│   └── ...
├── home/                           # Home Manager user environments
│   ├── hosts/                      # Per-host user overrides
│   └── users/                      # Per-user configurations
├── mix/                            # Host & user specifications, secrets
│   ├── default.nix                 # Host and user definitions (uses mix.nix)
│   ├── hostSpec.nix                # Host attribute schema
│   └── secrets.nix                 # Encrypted secrets (git-crypt)
├── modules/                        # Core NixOS & Home Manager modules
│   ├── hosts/
│   └── home/
├── dist/                           # ISO build configurations [WIP]
├── public/                         # Public assets & example secrets
└── .github/workflows/              # CI/CD automation

Core Components

Flake Management (flake.nix)

The central entry point using flake.parts for modularity:

  • External Dependencies: nixpkgs, home-manager, stylix, hardware modules, mix-nix, play, solaar, chaotic, niri, and others
  • System Outputs: Complete NixOS configurations auto-generated from host specifications
  • Library Extension: Extends nixpkgs.lib with utilities from mix.nix (lib.fs.*, lib.hosts.*, etc.)
  • Flake Modules: Imports from mix.nix and local ./mix directory for host/user management

Secret Management

  • Encryption: git-crypt secures sensitive data in mix/secrets.nix
  • Structure: Defined by mix/hostSpec.nix and mix.nix library
  • Content: SSH keys, API tokens, hashed passwords, SMTP credentials, VPN configurations

Host & User Specifications

  • mix/default.nix: Central orchestration point for the entire configuration using mix.nix:
    • User Definitions: Declares all users with their uid, shell, and group memberships
    • Core Module Configuration: Specifies modules/hosts/core as core modules applied to all hosts and modules/home/core as core Home Manager modules applied to all users
    • Host Definitions: Declares all hosts, each referencing a user and defining system-level settings (IP, desktop environment, mounts, VPN)
    • Secrets & Directory Mapping: Configures secrets file locations and maps host/user home directories
    • Special Arguments: Passes flake root and other arguments to all modules
  • mix/hostSpec.nix: Type schema extending the mix.nix host specification with dot.nix-specific attributes. See mix.nix documentation for the base schema and additional details.
  • mix/secrets.nix: Encrypted secret structure and values

System Architecture (hosts/)

Each host configuration is located at hosts/<hostname>/ and follows this pattern:

  • default.nix: Main configuration that imports hardware modules, host-specific service configurations, and optional common modules.
  • config/: Optional service-specific configurations and customizations that are auto-discovered and imported

Current Hosts

| Host | Type | Purpose | Hardware | Services | | ---------- | ------- | ---------------------- | --------------------------- | -------------------------------------------------- | | rune | Desktop | Workstation | Ryzen 9 7900X3D, RX 9070 XT | Gaming, Development, VMs | | haze | Desktop | Cesar's workstation | Ryzen 5 7600x, RX 7600 | Gaming, Development | | norion | Laptop | Work laptop | Ryzen AI 9 HX PRO 370 | Development, OLM client | | zebes | Server | Main server | Ryzen 7 5700X, RX 7900 GRE | Komodo (Docker), AI (Ollama, ComfyUI), Explorer | | nimbus | Server | Storage server | Ryzen 5 5600G | ZFS/BTRFS storage, NFS, FileRun, Backups, Newt | | nexus | Server | Router & services host | Intel N150 (2C), 2GB | Router, DHCP, DNS, AdGuard, Rathole, WireGuard VPN | | caenus | Server | ARM VPS | ARM 4vCPU, 24GB RAM, 200GB | Rathole server, Public IP endpoint | | vm | VM | Testing environment | Variable | System testing |


User Environment (home/)

User configurations are organized into two directories:

User-Specific Configurations

Located in home/users/<username>/, these configurations apply globally across all hosts for that user. Core Home Manager modules (shell, Git, SSH, etc.) are imported by mix.nix. This directory is for user-specific customizations and preferences that should be consistent across all machines the user accesses:

  • Theme Configuration: Stylix-based theming with wallpaper-generated color schemes
  • Custom Overrides: User-specific program configurations and preferences

Host-Specific Overrides

Located in home/hosts/<hostname>/, these configurations override or extend user settings on specific machines:

  • Monitor Configurations: Per-host monitor layouts via mix.nix
  • Desktop Customizations: GNOME dconf or desktop-specific settings
  • Host-Specific Theming: Theme variations tailored to each workstation

Current Users

| User | Theme | | --------- | ---------- | | toph | Invincible | | cesar | Soraka |


Theming & Customization

Desktop Environments

  • GNOME: PaperWM for tiling workflow, GNOME extensions (Blur My Shell, Vitals, Pano), and dconf customizations for enhanced usability
  • Niri: Wayland compositor with Vicinae application launcher for quick program access, available on designated hosts
  • Per-Host Customization: Monitor layouts, dconf settings, and UI tweaks customized per workstation via home/hosts/<hostname>/

mix.nix Integration

This repository depends on mix.nix, a reusable library that provides:

Declarative Host Management

  • Automatic nixosConfigurations generation from host specifications
  • User definition and reference system across multiple hosts
  • Seamless secrets access across all hosts via git-crypt integration (mix.nix expects encrypted secrets to be available)

Library Utilities

  • lib.fs.*: File system utilities (path scanning, relative paths)
  • lib.hosts.*: Host management utilities
  • lib.desktop.*: Desktop environment helpers
  • And many other utility functions

Flake-Parts Modules Provided by mix.nix

mix.nix provides flake-parts modules that integrate seamlessly into this repository's flake:

  • hosts: Auto-generates NixOS configurations from host specifications in mix/default.nix
  • secrets: Manages encrypted secrets access and validation
  • modules: Discovers and imports Nix modules from the configured directories
  • overlays: Provides custom package overlays system
  • packages: Exposes custom package definitions

Home Manager Modules

theme - Unified Theming System

The theme module from mix.nix provides a centralized theming specification that can be applied at either the user or host level:

  • Wallpaper-Based Color Generation: Automatically generates Material You color schemes from your wallpaper using matugen
  • Customizable Schemes: Supports multiple Material Design schemes (expressive, tonal-spot, vibrant, and more)
  • Per-User & Per-Host Flexibility: Define themes in home/users/<username>/ for consistent theming across all hosts, or in home/hosts/<hostname>/ for host-specific variations
  • Icon & Cursor Theming: Declarative specification of icon themes (Papirus, etc.) and cursor themes
  • Integration Points: Provides theme values that are consumed by Stylix and other configuration modules to apply colors system-wide (GTK, terminal, VS Code, etc.)

Other Home Manager Modules

  • monitors: Declarative multi-monitor configuration
  • fastfetch: System information display
  • nautilus: GNOME Files configuration including GTK bookmarks and custom folder icons

NixOS Modules

  • newt: Tunneling service for zero-trust access
  • olm: OLM client for Pangolin network access
  • oci-stacks: OCI container stack management

For complete mix.nix documentation, see github.com/tophc7/mix.nix.


Notable Features

View on GitHub
GitHub Stars65
CategoryDevelopment
Updated11d ago
Forks2

Languages

Nix

Security Score

85/100

Audited on Mar 21, 2026

No findings