Dotfile management using nix, home-manager, and stow.
- install nix
- add the
home-managerchannel:nix-channel --add https://github.com/nix-community/home-manager/archive/<RELEASE>.tar.gz home-manager- find the release from the github; it will be in the form
release-23.11
- find the release from the github; it will be in the form
nix-shell -p stow
nix-shell -p git- Get ssh sorted
git clone git@github.com:aaronArinder/doots.gitin your home directory
Neovim uses the .config directory. So, check that you're in the right directory (doots):
$ pwd
> doots
Doublecheck what stow will do:
stow --adopt -nv neovim
If it looks good (it should say LINK: .config => doots/neovim/.config), remove the -n and run:
stow --adopt -v neovim
.config here
cd machines
sudo stow --target=/etc/nixos <machine>
- Follow installaton for nix-darwin
- Make sure you get an
/etc/nix-darwin - Kill the initial flake and lockfile
sudo stow --target=/etc/nix-darwin ./nix-darwinfrom withinmachines/eolus- You should now be able to apply the config via
darwin-rebuild switch --impure- The impurity comes from loading modules into the flake
- Add channel:
nix-channel --add <channel-url> <channel-name>- Go to the repo and find the right release branch name for the target architecture, e.g.
nixpkgs-24.05-darwinfor darwin- For example:
nix-channel --add https://nixos.org/channels/nixpkgs-24.05-darwin nixos
- For example:
- Add the main channel and call it
nixos - Add the unstable channel and call it
unstable - Add home-manager
- Go to the repo and find the right release branch name for the target architecture, e.g.
- Update channels:
nix-channel --update - (Optional for darwin)
nix-channel --update darwin - Darwin: build/activate:
darwin-rebuild switch(potentially requiring the--impureflag) - Darwin: some machines (eg, eolus) use flakes and these require editing the flake to include the right nixpkgs version
- Update
nixpkgsversion:nix-channel --add <new-version-url> nixpkgs - Format:
nixpkgs-fmt ./path/to/file - Garbage collect the store:
nix-collect-garbage(-dto delete old profiles/generations for extra cleanup; see manpage)
man home-configuration.nix