Nix flake-based dotfiles for my Mac and home server.
| Area | Current setup |
|---|---|
| Mac host | srt-l03-shire |
| Home server | srt-n01-rivendell |
| User config | Home Manager |
| macOS system config | nix-darwin |
| NixOS server config | NixOS flake output with Home Manager and nixarr |
| Terminal emulator | Kitty plus kitty-dev |
| Shell | Nushell in Kitty |
| Server login shell | Bash, with Nushell installed for interactive use |
| Font | Hack Nerd Font Mono |
| Editor | Neovim |
| Browser | Firefox via Home Manager, Google Chrome via Mac GUI packages |
| Home server services | Jellyfin, Radarr, Prowlarr, qBittorrent, Seerr, and Pi-hole |
The main flake outputs are:
homeConfigurations.srt-l03-shiredarwinConfigurations.srt-l03-shirenixosConfigurations.srt-n01-rivendell
Ok so I am one of those people who are all in on the "nix hype train". That is why this might look unfamiliar to someone who does not know what nix is.
Nix is a philosophy, a programming language, a package manager and an OS. All this culminates in a unique approach to package management and system configuration. The end result is reproducible, declarative and reliable systems.
Think of it like git but for your system, package management, etc.
:mind_blown:
Now if you are still with me and want to know more about it. Here are a few helpful links that you can visit to know more about it.
- Watch first 6 minutes of this video to get a gist of nix package management and how it's different from standard package management and then building on that what is NixOS)
- If the previous video peeks your curiosity then I recommend looking at this to get a deeper understanding
- Finally, if you decide that this is something you want for yourself. Then this brilliant playlist might just be the perfect place to start.
These commands assume the repo lives at ~/.dotfiles.
Requirements:
- nix with flake support is available
Apply the Home Manager config:
cd ~/.dotfiles
home-manager switch --flake "./#srt-l03-shire" -b backupThe Home Manager config also installs an apply-user helper that runs the same
switch from ~/.dotfiles.
Apply the nix-darwin config:
sudo darwin-rebuild switch --flake ~/.dotfiles/.#srt-l03-shireThe Home Manager config also installs an apply-darwin helper for this.
The NixOS server flake output is nixosConfigurations.srt-n01-rivendell.
The host config lives under hosts/srt-n01-rivendell/.
The normal remote switch from the Mac builds and deploys over Tailscale:
env NIX_SSHOPTS='-i /Users/nixypanda/.ssh/github-key -o StrictHostKeyChecking=accept-new' \
nix run nixpkgs#nixos-rebuild -- switch \
--flake .#srt-n01-rivendell \
--build-host nixypanda@100.127.3.54 \
--target-host nixypanda@100.127.3.54 \
--no-reexec \
--use-substitutes \
--ask-sudo-passwordOn the server itself, the equivalent is:
sudo nixos-rebuild switch --flake ~/.dotfiles#srt-n01-rivendellcd ~/.dotfiles
nix flake update --flake .The Home Manager config also installs an update-flake helper for this.
See AGENTS.md → "Tests / Validation" for the evaluation and build checks.
Rivendell homelab secrets under services/secrets/ are encrypted with
agenix. If you plan to use these dotfiles,
replace those files with your own secrets or remove the references from the
codebase.
flake.nixwires the Mac Home Manager output, Mac nix-darwin output, and the NixOS home server output.- Reusable user/program modules live under
modules/home/; shared system modules live undermodules/system/. - NixOS service modules live under
services/. - Per-host configuration lives under
hosts/<host>/. - Neovim Lua config lives under
modules/home/nvim/lua/. - Homelab service docs live in
services/README.md.