The dots used to be managed by a custom script that I wrote, which was very much prone to breakages, so I took a flaky approach.
This is an experimental branch where I’m testing nix.
I wish to work with a single file mindset and see how far I can take it, that’s why I opted to not use home-manager and use GNU Stow instead for dotfiles symlink.
- Flakes first steps
- Shell scripts with nix
- Installing a specific version with nix (explains how to work with overlays)
- Declarative management of dotfiles with Nix and Home Manager
- Managing dotfiles with nix
- Get the list of packages to replace using
brew leaves
. - Install nix:
curl -L https://nixos.org/nix/install | sh
.
- Create ./flake.nix
- Run
nix --extra-experimental-features "nix-command flakes" profile install . --impure
in the dotfiles directory. - Run
stow <dir>
to symlink the dotfiles. e.g.:stow nix
(To not link and see what the stow command will do, runstow -nv linux
) - To upgrade the packages, run
nix flake update
and thennix profile upgrade dotfiles --impure
- To upgrade specific flake inputs
nix flake update emacs-overlay
- Remember to run
nix-collect-garbage -d
to clean up old generations and to save space.
- If you’re using macos, check ./bin/bin/nix-mac-app to add nix apps so that they can be indexed by spotlight and copy nix fonts to a location where they’re discoverable.