niv
niv copied to clipboard
Custom updater script
How would I use niv to update package, that requires custom update script?
For example
to update https://github.com/srghma/nixpkgs/blob/aadfa893ab25d2410590faff1e3fbbdd4d89b2e3/pkgs/applications/misc/hubstaff/default.nix
there is a script https://github.com/srghma/nixpkgs/blob/aadfa893ab25d2410590faff1e3fbbdd4d89b2e3/pkgs/applications/misc/hubstaff/update.sh
that finds last version of hubstaff package on s3 and makes file https://github.com/srghma/nixpkgs/blob/aadfa893ab25d2410590faff1e3fbbdd4d89b2e3/pkgs/applications/misc/hubstaff/revision.json that is then imported builtins.fromJSON (builtins.readFile ./revision.json);
How would one use niv for hubstaff?
Could niv configuration file store script that is needs to run in order to update?
Forgot to reply, even though I gave this a lot of thought. I think we can add a field in the package spec like { owner = "foo"; repo = "bar"; updater = "path/to/updater"; }
where path/to/updater
is the path to a custom script (like hubstaff's update.sh
). What do you think?
I think it makes more sense to make the updater
not script, but derivation that builds a script
If we adopted the overlays approach in https://github.com/nmattia/niv/pull/137, we could plausibly have an __updaters
attrset that maps an updater
value to a derivation that produces some updated attrs.
FWIW I started some work here: https://github.com/nmattia/niv/tree/nm-custom Was out since but will resume work soon.