This is my dotfiles repo, there are many like it ;)
Uses home-manager to manage the configuration for several machines.
Home Manager has a number of nice benefits beyond what most dotfile manager tools provide:
- more than just dotfiles, actually manages the packages themselves from the extensive (and fairly up-to-date) NixPkgs
- Allows clean rollbacks (
home-manager switch --rollback) - Consistent and integrated configuration for popular
programs - Can manage user
services!
In any case was enough to convince me to take the plunge. While the learning curve can be a bit steep and the documentation inscrutable at times I've been happy with it so far.
Home-manager (and Nix in general) allows a lot of freedom in how you structure and manage your configuration. I hope others might find my take on things helpful on their Nix journey.
nix: Most of my hosts are Arch so# pacman -S nixand# systemctl enable --now nix-daemondoes the trick.
git clone git@github.com:anntoin/dotfiles.git ~/.config/home-manager/cd ~/.config/home-managerhome-manager switch --flake .
This only needs to be done on the initial run, updates are done automatically afterwards.
After updating any files you'll need to run home-manager switch to deploy your
changes. There are ways to get around this but I haven't found it to be much of
a hassle and it can make you be a bit more deliberate when making changes.
To update package versions (once they've landed in NixPkgs) you'll need to
update the flake.lock file. Just manually run nix flake update and, all
being good, commit that version. Once other hosts pull down that version
automatic updates will take care of the rest.