The function below lets you create a directory in your home-manager config that auto-creates symlinks for non-Nix dotfiles from ~/.config/ using xdg.configFile and mkOutOfStoreSymlink. This gives the following advantages:
- You can keep all your non-Nix dotfiles in your home-manager repo.
- You don't have to do
home-manager switchon each dotfile change. Changes are instantly reflected. - You don't need to hard-code the paths for each symlink, the linking is instead file-based. Just add the new dotfile to the directory, and you're done.
For example, if your home-manager config is in ~/nixos/ and looks like this...:
~/nixos