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>.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 [email protected]:aaronArinder/doots.git
in 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-darwin
from 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-darwin
for 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
- 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