curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"mkdir -p ~/.config
git clone https://github.com/svnlto/nix-config.git ~/.config/nixFind the hostname and username:
scutil --get LocalHostName
whoamiAdd it to darwinConfigurations in flake.nix:
darwinConfigurations = {
# Personal Mac — includes personal casks (proton, discord, zwift, etc.)
"rick" = mkDarwinSystem {
hostname = "rick";
username = defaultUsername;
extraModules =
[ ./systems/aarch64-darwin/homebrew/personal.nix ];
};
# Work Mac — only shared casks, add work-specific ones via work.nix
"<work-hostname>" = mkDarwinSystem {
hostname = "<work-hostname>";
username = "<work-username>";
extraModules =
[ ./systems/aarch64-darwin/homebrew/work.nix ];
};
};Casks are split per host type:
systems/aarch64-darwin/homebrew/common.nix— shared across all Macs (dev tools, productivity, browsers)systems/aarch64-darwin/homebrew/personal.nix— personal-only (proton, discord, signal, zwift, utm, etc.)systems/aarch64-darwin/homebrew/work.nix— work-specific (empty placeholder, add as needed)
All hosts get common.nix via the base darwin import. Use extraModules in flake.nix to layer on host-specific casks.
cd ~/.config/nix
darwin-rebuild switch --flake .#$(scutil --get LocalHostName)The first run installs nix-darwin, Home Manager, and all packages. Subsequent runs use nixswitch.
- 1Password: Install manually for SSH key integration
- Shell: Restart your terminal to pick up the new zsh config
The nixswitch alias auto-detects hostname, so both machines use the same command going forward.