Keeping a home environment consistent across machines usually means scattered configs, manual installs, and "works on my machine" drift. This flake declares the entire home environment as code — packages, dotfiles, and tool configs all version-controlled in one place — so one command applies a fully reproducible setup on any supported machine.
New machine, no Nix installed — one-liner that installs Nix (via the
Determinate installer) if missing and applies this flake.
No local clone or git needed:
curl -fsSL https://raw.githubusercontent.com/NoSugarCoffee/dotnix/main/scripts/bootstrap-macos.sh | bashIf Nix wasn't installed yet, open a new terminal after the installer finishes and re-run.
Already have Nix, no home-manager yet — bootstrap the first switch:
# Linux
nix run .#home-manager -- switch --flake .#liangliangdai
# macOS
nix run .#home-manager -- switch --flake .#liangliangdai-aarch64-darwinDay to day — once just is on PATH:
just switch| 🍎 🐧 Both | 🍎 macOS only | 🐧 Linux only | |
|---|---|---|---|
| AI | codex · claude-code · claude-desktop · pi · apm · ccstatusline · paperclip · orca · agent-access · bitwarden-cli · grok-bot | ChatGPT | — |
| Terminal | kitty · zellij · zoxide · yazi · nix-zsh-completions | — | — |
| Editors | intellij-idea-ultimate · cursor | jetbrains-air · pulsar | — |
| Dev | git · git-open · gh · glab · docker (client) · docker-compose · asdf (go, nodejs, java, maven) · pnpm · python3 (ipython, pip) · just · lark-cli | colima | — |
| Browsers | — | google-chrome · ego-lite | — |
| Screen | obs-studio | macshot | — |
| Network | clash-verge-rev | — | — |
| Utilities | — | albert · maccy · scroll-reverser · cida | copyq |
| Command | Description |
|---|---|
just switch |
Apply the configuration |
just build |
Build without switching |
just generations |
Show Home Manager generations |
just update |
Update flake inputs |
just show |
Show flake outputs |
The username is a single source of truth in flake.nix:
let
username = "liangliangdai";Everything else (homeConfigurations attribute names, home.username,
homeDirectory, CI USERNAME, the bootstrap script's flake target)
reads from there directly or via nix eval --raw .#username. Fork the
repo and change just that string — that's the whole rebranding step.
- zsh is managed. Move an existing
~/.zshrcaside before the first switch; machine-local config goes in an untracked~/.zshrc-local. - git config is not. Per-checkout identity needs
includeIfpaths, so~/.gitconfigis hand-written. - Codex and Claude Code settings stay writable. A switch seeds them if missing and resets only the keys declared in
apps/codex/managed.tomlandapps/claude-code/settings.nix. - asdf pins Go / Node / Java / Maven to explicit versions in
apps/asdf/default.nix. Python comes from nixpkgs instead, since asdf compiles it from source. - Docker on macOS is colima. A launchd agent starts the VM at login; resize it with
colima stop && colima start --cpu 4 --memory 8. On Linux the daemon is a system service, out of scope here. - Ad-hoc-signed macOS apps are re-signed locally. Nix builds like kitty and Albert carry a signature that changes with every rebuild, which silently invalidates Accessibility / Screen Recording grants. A switch re-signs their copies in
~/Applications/Home Manager Appswith a self-signeddotnix local code signingcertificate it creates in the login keychain, so grants survive updates. The first switch that migrates an app to this identity still changes its code identity once -- macOS treats that as a new app, so expect to re-grant Accessibility / Screen Recording for kitty and Albert one more time right after that switch; it then sticks across every rebuild after. Without a login keychain at~/Library/Keychains/login.keychain-db(headless activation, CI) it warns and leaves the copy ad-hoc signed instead of failing. - China mirrors.
scripts/bootstrap-macos.shadds SJTU/TUNA/USTC substituters; check withnix config show | grep substitut.
MIT — see LICENSE.
