3 ms·
I see a lot of people talk about homemanager, but I've been happy enough with the following in my configuration.nix: system.activationScripts = { dot
by chriswarbo 5y ago
I 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