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
{pkgs ? import <nixpkgs> {}}:
with pkgs;
{
work-helpers = stdenv.mkDerivation {
name = "work-helpers";
src = lib.cleanSource ./.;
buildPhase = ''
true
'';
installPhase = ''
install -D -m 755 ./tool-1 "$out/bin/tool-1"
install -D -m 755 ./tool-2 "$out/bin/tool-2"
install -D -m 755 ./tool-3 "$out/bin/tool-3"
'';
};
}
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?