Personal NixOS and nix-darwin configuration files using Nix flakes. This repository contains configurations for multiple devices across different architectures and use cases.
| Device | Description | Architecture | Role | Notes |
|---|---|---|---|---|
| beehive | Beelink SER9 Pro | x86_64 | Home Server | Media server with Jellyfin, Plex, *arr stack |
| earth | Intel NUC 10 i7 | x86_64 | Mini PC | Compact desktop |
| hyperion | HP EliteBook 845 G8 | x86_64 | Laptop | Desktop with Pantheon DE |
| miranda | HP EliteBook 1030 G2 | x86_64 | Laptop | Portable workstation |
| phoebe | ThinkPad P14s AMD Gen 5 | x86_64 | Laptop | Development machine |
| tethys | Zotac ZBox | x86_64 | Mini PC | Compact desktop |
| titan | CyberPowerPC | x86_64 | Desktop | High-performance workstation |
| Device | Description | Architecture | Role | Notes |
|---|---|---|---|---|
| salacia | Mac Mini 2024 | aarch64 | Desktop | Apple Silicon workstation |
| vesta | MacBook Pro 2020 | x86_64 | Laptop | Intel-based portable |
| charon | MacBook Air 2018 | x86_64 | Laptop | Lightweight portable |
| Device | Description | Architecture | Role | Notes |
|---|---|---|---|---|
| mars | ThinkPad X13s Gen 1 | aarch64 | Desktop | Portable workstation with cellular |
- Git - Version control with custom configuration
- Neovim/Nixvim - Modern Vim-based editor with Nix configuration
- Helix - Post-modern text editor
- GitHub CLI (gh) - GitHub integration
- Just - Command runner for project automation
- Fish - Friendly interactive shell
- Atuin - Magical shell history
- Starship - Cross-shell prompt
- Fzf - Fuzzy finder
- Direnv - Environment variable management
- Eza - Modern ls replacement
- Bat - Cat with syntax highlighting
- Ripgrep - Fast text search
- Bottom - System resource monitor
- Home Manager - Declarative user environment management
- Nix Helper (nh) - Simplified Nix commands
- SOPS - Secrets management
- Disko - Declarative disk partitioning
- Lanzaboote - Secure Boot for NixOS
- Jellyfin - Media server (earth)
- Plex - Media server (earth)
- Sonarr/Radarr/Lidarr - Media automation (earth)
- Prowlarr - Indexer management (earth)
-
Nix with flakes enabled:
# On NixOS, enable in configuration.nix: nix.settings.experimental-features = [ "nix-command" "flakes" ]; # On other systems, add to ~/.config/nix/nix.conf: experimental-features = nix-command flakes
-
Required tools:
nix profile install nixpkgs#git nixpkgs#just nixpkgs#nh
-
Clone the repository:
git clone https://github.com/keanu/nix-config ~/.config/nix-config cd ~/.config/nix-config
-
Set up SOPS encryption (for secrets):
# Generate age key from SSH key: ssh-to-age -private-key -i ~/.ssh/id_ed25519 > ~/.config/sops/age/keys.txt # Or generate new age key: age-keygen -o ~/.config/sops/age/keys.txt # Get public key for adding to .sops.yaml: age-keygen -y ~/.config/sops/age/keys.txt
The configuration uses Just for convenient command execution:
# List all available commands
just
# Build and switch both OS and Home Manager
just switch
# Build and switch only Home Manager
just home
# Build and switch only OS configuration
just host
# Update flake inputs
just update
# Clean up old generations
just gcIf you prefer manual commands:
# NixOS system
sudo nixos-rebuild switch --flake .#hostname
# nix-darwin
darwin-rebuild switch --flake .#hostname
# Home Manager
home-manager switch --flake .#username@hostname.
βββ flake.nix # Entry point: inputs + flake-parts.lib.mkFlake + import-tree ./modules
βββ flake.lock # Locked dependency versions
βββ justfile # Task runner commands
βββ lib/{cosmic,wallpapers}/ # Static assets (catppuccin theme submodule + wallpaper images)
βββ secrets/ # Encrypted secrets (SOPS)
βββ modules/
βββ flake/ # flake-parts wiring (systems, formatter, devshells, packages, hydra, nixConfig)
βββ meta/domains.nix # options.domains β primary domain, services, ports
βββ configurations/ # option trees β flake.{nixos,darwin,home}Configurations + deploy.nodes
β βββ nixos.nix # configurations.nixos.<host> (unstable)
β βββ nixos-stable.nix # configurations.nixos-stable.<host> (VPS, stable 25.11)
β βββ darwin.nix
β βββ home-manager.nix # both unstable + stable
β βββ deploy-rs.nix
βββ nixpkgs/ # overlays, custom packages, fix overlays
βββ secrets/ # sops-nix wiring (NixOS + home-manager)
βββ nixos/ # flake.modules.nixos.<role> β base, pc, laptop, server, vps, wsl, amd, β¦
β βββ desktop/<de>/ # cosmic, gnome, pantheon, plasma, hyprland (one DE per directory)
β βββ programs/<name>/ # fuse, nh, nix-ld, evolution, gamescope, steam
β βββ services/<name>/ # the 43 services (cloudflared, jellyfin, ollama, β¦)
β βββ users/ # user-keanu, user-kimmy
β βββ fixes/ # opt-in fix-* roles
βββ darwin/ # flake.modules.darwin.<role>
β βββ services/<svc>/
β βββ users/
βββ home/ # flake.modules.homeManager.<role>
β βββ shell/<tool>/ # fish, starship, atuin, git, neovim, β¦
β βββ desktop/<app>/ # firefox, vscode, kitty, β¦
β βββ dev/<lang>/ # rust, python, go, nix, β¦
β βββ services/openclaw/
βββ hosts/<host>/ # per-host composition
βββ imports.nix # composes roles via with config.flake.modules.nixos / darwin
βββ home.nix # writes home-manager.users.<u> + standalone homeConfigurations
βββ _hardware-configuration.nix
βββ _disko-configuration.nix
This configuration uses the dendritic pattern with flake-parts and import-tree. Every .nix file under modules/ (except those starting with _) is a top-level flake-parts module, auto-imported into a single configuration tree. Files compose by writing to flake.modules.<class>.<role> deferredModules, which merge automatically.
How it works:
-
Each feature is a module that contributes to a role. A service file under
modules/nixos/services/<svc>/default.nixwrites:{ flake.modules.nixos.svc-<svc> = { ... NixOS config ... }; }
Multiple files writing to the same role merge into one deferredModule.
-
Hosts compose roles by reference, not by path. A host's
modules/hosts/<host>/imports.nixdoes:{ config, ... }: { configurations.nixos.<host>.module = { imports = with config.flake.modules.nixos; [ base laptop desktop cosmic svc-btrfs user-keanu home-manager ]; networking.hostName = "<host>"; system.stateVersion = "..."; }; }
-
No more
specialArgsplumbing. Cross-cutting values likedomainslive as top-level options (options.domains) and are read at flake-parts scope, then captured into deferredModules via closure. -
Consistent across platforms.
flake.modules.nixos.<role>,flake.modules.darwin.<role>, andflake.modules.homeManager.<role>use the same pattern. -
Underscore-prefixed files (
_hardware-configuration.nix,_aliases.nix,_fixes/,_pkgs.nix) are skipped byimport-treeand imported by path where needed β used for raw NixOS / home-manager modules and data files that aren't flake-parts modules themselves.
Benefits:
- Discoverability β browse
modules/to see every available feature - Composition by name β hosts list role names, not paths
- Free file motion β paths represent features, so files can be moved or split without breaking imports
- Cross-platform sharing β modules that span NixOS / Darwin / home-manager can be a single file
- Catppuccin theme across applications
- Stylix for system-wide theming
- Consistent fonts: Inter, JetBrains Mono, Nerd Fonts
- SOPS-nix for secrets management
- Lanzaboote for Secure Boot on supported systems
- Age encryption for sensitive data
- Btrfs with snapshots on supported systems
- Disko for declarative disk management
- Impermanence for ephemeral root filesystem
# Update all flake inputs
just update
# Update specific input
nix flake update nixpkgs
# Check for available updates
nix flake show --allow-import-from-derivation# Remove old generations (keep 5 most recent)
just gc
# Manual cleanup
nix-collect-garbage -d
sudo nix-collect-garbage -d # On NixOS# Check configuration syntax (skip building closures)
nix flake check --no-build
# Spot-check one host evaluates
nix eval --raw .#nixosConfigurations.<host>.config.system.build.toplevel.drvPath
nix eval --raw .#homeConfigurations.\"<user>@<host>\".activationPackage.drvPath
# Build without switching
just build-host # or just build-home
# View build logs
nix log /nix/store/...- Multi-architecture support (x86_64, aarch64)
- Cross-platform (NixOS, macOS)
- Declarative secrets management with SOPS
- Automated media server setup (earth)
- Consistent development environment across all machines
- Secure Boot support where applicable
- Ephemeral root filesystem with impermanence
- Custom overlays and packages
This is a personal configuration, but feel free to:
- Use parts of this configuration for your own setup
- Report issues or suggest improvements
- Submit PRs for general improvements
This project is licensed under the MIT License - see the LICENSE file for details.