4 ms·
Nix plus homemanager plus direnv is the best solution I have found so far. Managing config (dotfiles) is only one part of the problem. You usually also need som
by kohlerm 5y ago
Nix plus homemanager plus direnv is the best solution I have found so far. Managing config (dotfiles) is only one part of the problem. You usually also need some way to install applications/tools ideally in a specific version. your config might not work as expected with a different version and you would have to remember what exactly you installed. As a developer using direnv will even allow you to use different versions of tools for different projects/ directories
- rofrol 5y agoCan you describe more your setup? Some repo?
- bsima 5y agoHeres home-manager repo you could try to learn from: https://simatime.com/git/ben/cfg.git/ https://simatime.com/git/ben/cfg.git/
- flukus 5y agodirenv is one of those things I've never found a use for because it's so simple to roll your own and because there are invariably situations I have that they don't handle well, my work needs don't map well to a directory based approach for example. My home implementation that's evolved over the years is about 60 lines of bash but a simple bare bones (and unsafe) one is as easy as: function cd { builtin cd "${@}"; [[ -f "$PWD/.env" ]] && source "$PWD/.env"; } To me stow seems similar, I see little to no advantage over a script/makefile that creates the symlinks and you have the complexity of another tool to learn.
- chriswarbo 5y agoI see a lot of people talk about homemanager, but I've been happy enough with the following in my configuration.nix: system.activationScripts = { dotfiles = '' cd /home/chriswarbo/.dotfiles || exit 1 for X in * do [[ -h "/home/chriswarbo/.$X" ]] && continue [[ -e "/home/chriswarbo/.$X" ]] && { echo "WARNING: Found ~/.$X but it's not a symlink" 1>&2 continue } (cd /home/chriswarbo && ln -s .dotfiles/"$X" ."$X") done ''; }; I've been using NixOS for many years, but my dotfiles repo goes back even further ;)
- vereis 5y agoFor me, one plus of home-manager is that I can easily use it and share modules between NixOS and, say, Alpine + Nix