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 # Main flake configuration
βββ flake.lock # Locked dependency versions
βββ justfile # Task runner commands
β
βββ nixos/ # NixOS configurations
β βββ _mixins/ # Reusable NixOS configuration modules
β β βββ base/ # Base system configs (boot, impermanence, laptop, server, etc.)
β β βββ desktop/ # Desktop environments (COSMIC, GNOME, Hyprland, Pantheon, Plasma)
β β βββ programs/ # System programs (nh, Steam, Evolution)
β β βββ services/ # System services (Jellyfin, Plex, *arr, Tailscale, etc.)
β β βββ user/ # User account configurations
β β βββ virtualization/ # Virtualization configs
β βββ beehive/ # Beelink SER9 Pro
β βββ earth/ # Intel NUC server
β βββ hyperion/ # HP EliteBook 845 G8
β βββ miranda/ # HP EliteBook 1030 G2
β βββ phoebe/ # ThinkPad P14s AMD Gen 5
β βββ tethys/ # Zotac ZBox
β βββ titan/ # CyberPowerPC desktop
β βββ mars/ # ThinkPad X13s Gen 1 (WSL)
β
βββ darwin/ # macOS (nix-darwin) configurations
β βββ _mixins/ # Reusable Darwin configuration modules
β β βββ base/ # Base macOS configs
β β βββ desktop/ # Desktop-related macOS configs
β β βββ services/ # macOS services
β β βββ user/ # User account configurations
β βββ salacia/ # Mac Mini 2024
β βββ vesta/ # MacBook Pro 2020
β βββ charon/ # MacBook Air 2018
β
βββ home/ # Home Manager configurations
β βββ _mixins/ # Reusable Home Manager modules
β β βββ base/ # Base home configs (default, impermanence, server, wsl)
β β βββ darwin/ # Darwin-specific home configs
β β βββ desktop/ # Desktop apps (Firefox, VSCode, GNOME, Kitty, Thunderbird, Zed, etc.)
β β βββ dev/ # Language toolchains (C, Rust, Python, Go, Nix, Java, etc.)
β β βββ shell/ # Shell tools (Fish, Starship, Atuin, Git, Neovim, Helix, etc.)
β βββ [hostname]/ # Per-host user configurations (e.g., hyperion/keanu.nix)
β
βββ modules/ # Custom NixOS and Home Manager modules
β βββ nixos/ # NixOS modules
β βββ home-manager/ # Home Manager modules
βββ overlays/ # Package overlays
βββ pkgs/ # Custom packages
βββ secrets/ # Encrypted secrets (SOPS)
This configuration uses a _mixins pattern for modular, composable system configuration. Instead of a monolithic common/ directory, configurations are organized into small, focused modules that can be mixed and matched per host.
How it works:
-
Mixins are organized by category - Each
_mixins/directory contains subdirectories grouping related functionality (e.g.,base/,desktop/,services/) -
Host configurations import only what they need - Each host's
default.niximports specific mixins:# Example: nixos/hyperion/default.nix imports = [ ../_mixins/base/default.nix ../_mixins/base/laptop.nix ../_mixins/desktop/pantheon/default.nix ../_mixins/services/tailscale/default.nix ]; -
Fine-grained composition - Mix and match exactly the features needed:
- A laptop gets
base/laptop.nix, a server getsbase/server.nix - Desktop systems import specific DE mixins (GNOME, Pantheon, Hyprland, etc.)
- Media servers import only the services they need (Jellyfin, Plex, Sonarr, etc.)
- A laptop gets
-
Consistent across platforms - The same pattern is used for:
- NixOS (
nixos/_mixins/) - System-level configuration - Darwin (
darwin/_mixins/) - macOS system configuration - Home Manager (
home/_mixins/) - User-level configuration
- NixOS (
Benefits:
- Clarity - Easy to see exactly what features a host uses
- Reusability - Mixins are shared across hosts without duplication
- Flexibility - Add or remove features by changing imports
- Discoverability - Browse
_mixins/to see available options
- 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
nix flake check
# 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.