At work we have a few repos on GitHub with utility scripts. I made a naive attempt at packaging them by sticking a default.nix in the root. Something like
Then I added the repo as a channel using nix-channel. That works as expected.
Then I realised that this doesn't pick up changes pushed to the repo, nix-channel --update works of course, but a subsequent nix-env --upgrade won't build a new version incorporating the pushed changes to the scripts.
If I want to remedy this, i.e. to make nix-env --upgrade pick up that the scripts have been modified and build a new package, what are my options?
At work we have a few repos on GitHub with utility scripts. I made a naive attempt at packaging them by sticking a
default.nix
in the root. Something likeThen I added the repo as a channel using
nix-channel
. That works as expected.Then I realised that this doesn't pick up changes pushed to the repo,
nix-channel --update
works of course, but a subsequentnix-env --upgrade
won't build a new version incorporating the pushed changes to the scripts.If I want to remedy this, i.e. to make
nix-env --upgrade
pick up that the scripts have been modified and build a new package, what are my options?I think you will have to put a version in your derivation. maybe by reading
.git/refs/heads/master
oops no, that won't register correctly, since the versions are compared
also there is the
--always
flag fornix-env --upgrade
Yes, it works well enough to use
--always
:smile: