Compare commits

..

2 commits

Author SHA1 Message Date
796a55f602
Add aliass for home-manager commands 2025-07-23 13:40:39 -05:00
f765ba9a39
Refactor: make home-manager actually record changes
I'm not entirely sure this whole rigamaroll was worth it, but basically
I noticed that for some reason Ansible was skipping doing the
home-manager derivation when running playbooks back-to-back. So I fixed
that, or so I think. To make sure the derivation only happens when the
repo is updated, I added an activation script to the home-manager
config. Yes, technically the Nix part of the repo could be untouched and
yet still trigger a rebuild, but that's fine. I hope this convoluted
logic tree doesn't break down.
2025-07-23 13:34:20 -05:00

View file

@ -65,10 +65,10 @@ in {
};
sessionPath = [ "$HOME/.local/bin" ];
activation = {
recordHmGitHash = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
rec-hm-git-hash = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
cd "$HOME/.config/home-manager" || exit 1
if [ -z "$(${pkgs.git}/bin/git status --porcelain --untracked-files=no)" ]; then
run echo "$(${pkgs.git}/bin/git rev-parse HEAD)" | tee $HOME/.cache/hm-git-hash
if [ -z "$(git status --porcelain --untracked-files=no)" ]; then
run echo "$(git rev-parse HEAD)" | tee $HOME/.cache/hm-git-hash
else
run echo '*' | tee $HOME/.cache/hm-git-hash
fi