Personal dotfiles repository based on Nix Home Manager with per-host configuration support.
dotfiles/
├── flake.nix # Nix flake configuration (mkConfig helper)
├── flake.lock
├── options.nix # Custom options (hostname, desktop)
├── hosts/ # Host-specific configurations
│ └── bemba.nix # Example: desktop workstation
├── common/ # Shared configuration
│ ├── default.nix # Base packages and programs
│ ├── git/ # Git configuration
│ ├── security.nix # GPG and SSH setup
│ ├── shell/ # ZSH, Atuin, Powerlevel10k
│ └── tools/ # Helper scripts
├── personal/ # Personal profile overrides
│ └── default.nix
├── work/ # Work profile (git submodule)
│ └── hosts/ # Work host-specific overrides (optional)
└── AGENTS.md
Configuration is layered: common → user (personal/work) → host.
options.nixdefinesdotfiles.hostname(string) anddotfiles.desktop(bool, defaultfalse/headless)hosts/<hostname>.nixsets host-specific options (e.g.dotfiles.desktop = true)work/hosts/<hostname>.nixoptional work-specific host overrides from the submoduleflake.nixgeneratesuser@hosttargets automatically from thehostsmapping
Any module can use config.dotfiles.desktop to conditionally include desktop-only config.
- Create
hosts/<hostname>.nixwith host-specific settings - Add the host to the
hostsmapping inflake.nix:<hostname> = "<user>"; - Optionally add
work/hosts/<hostname>.nixfor work-specific overrides
git clone --recurse-submodules https://github.com/matthiasemde/dotfiles.git ~/dotfiles
cd ~/dotfiles
nix run nixpkgs#home-manager -- switch --flake .The hmu alias auto-detects the hostname and uses the matching user@host target (falling back to the plain user default if no host config exists).
| Target | Description |
|---|---|
matthias |
Personal profile, generic/headless |
emdem |
Work profile, generic/headless |
emdem@bemba |
Work profile on bemba (desktop) |
nix flake update- nix