A comprehensive NixOS configuration using Nix Flakes for declarative system and user environment management across multiple machines.
Enter the development shell to get all necessary tools (make, nh, git, etc.):
# Manual activation
nix develop
# Or use Make
make dev
# Automatic activation with direnv
direnv allow# Switch NixOS configuration (nh)
make switch
# Switch home-manager configuration (nh)
make home-switch
# Check flake outputs
make check
# Format Nix files
make fmt
# Run GC for store paths older than 3 days
make gc
# Update flake inputs
make update
# Show all available commands
make help# Deploy to dathomir
make deploy/dathomir
# Deploy to dev-vm
make deploy/dev-vmSet up a development VM for testing configurations. Configure the connection details with environment variables:
export NIXADDR=192.168.1.100 # VM IP or hostname (no user)
export NIXUSER=przemek # SSH user after bootstrap (default)
export NIXNAME=dev-vm # Flake configuration to apply# Get detailed VM setup instructions
make vm/setup-help
# Quick workflow (after VM setup):
make vm/bootstrap0 # Initial VM setup (uses root@${NIXADDR})
make vm/bootstrap # Copy repo + apply configuration
make vm/switch # Deploy changesBuild and install NixOS WSL distribution with CLI tools from dev-vm configuration:
make wslThis creates a WSL distribution tarball builder. To generate the actual tarball:
sudo result/bin/nixos-wsl-tarball-builderThis produces a nixos.wsl file ready for Windows installation.
-
Transfer the tarball: Copy
nixos.wslto your Windows machine -
Install WSL distribution (run in PowerShell as Administrator):
wsl --import NixOS C:\WSL\NixOS C:\path\to\nixos.wsl -
Set as default (optional):
wsl --set-default NixOS
-
Launch NixOS WSL:
wsl -d NixOS
- List distributions:
wsl --list --verbose - Stop distribution:
wsl --terminate NixOS - Uninstall:
wsl --unregister NixOS - Update: Rebuild tarball and re-import
The WSL configuration includes CLI development tools from dev-vm:
- Modern shell (Fish with completions)
- Development tools (git, nvim, tmux, fzf, ripgrep, etc.)
- Programming languages (Node.js, Python 3)
- Container tools (docker-compose)
- Network utilities (SSH, Tailscale)
- Nix package manager with flakes enabled
This flake supports multiple machines:
- ilum - Gaming desktop
- dathomir - Dell laptop
- dooku - Lenovo ThinkPad
- dev-vm - Development VM (universal: QEMU/KVM, Hyper-V, VirtualBox)
- wsl - Windows Subsystem for Linux configuration
- Modular design - Shared configuration with host-specific overrides
- Multiple nixpkgs channels - Stable, unstable, and legacy for compatibility
- Universal VM support - Works across different hypervisors
- Makefile automation - Simple commands for all operations
- bspwm/Hyprland desktop environments
- Comprehensive app configurations (Neovim, Firefox, development tools)
- VM-optimized configurations for development
- Remote deployment with deploy-rs
- Automatic formatting and development tools
- NixOS & Flakes Book - Comprehensive guide
- devenv - Development environments
- Flake templates - Starting templates
flake.nix- Main flake configurationlib/mkSystem.nix- System configuration factoryhosts/- Machine-specific configurationsMakefile- Development workflow automationCLAUDE.md- Claude Code assistant reference
# Check configuration syntax
make check
# Format Nix files
make fmt
# Clean broken symbolic links
find -L /nix/var/nix/gcroots/per-user/$USER -maxdepth 1 -type l -delete