Dotfile management using nix, home-manager, and stow.
- install nix
- add the
home-manager
channel:nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.11.tar.gz home-manager
stow
can be installed in an ephemeral shell (it's primarily useful in system setup, and we can't just plop it in a machine's config file because we're usingstow
during the boostrapping process):nix-shell -p stow
cd machines
sudo stow --target=/etc/nixos <machine>
cd machines
sudo stow --target $HOME/.nixpkgs <machine>
- Add channel:
nix-channel --add <channel-url> <channel-name>
- Update channels:
nix-channel --update
- Darwin: build/activate:
darwin-rebuild switch
- Update
nixpkgs
version:nix-channel --add <new-version-url> nixpkgs
- Format:
nixpkgs-fmt ./path/to/file
- Garbage collect the store:
nix-collect-garbage
(-d
to delete old profiles/generations for extra cleanup; see manpage)
man home-configuration.nix