2019-08-05 18:02:06 +00:00
|
|
|
{ runCommand
|
|
|
|
, nix
|
|
|
|
, bash
|
|
|
|
, git
|
|
|
|
, jq
|
|
|
|
, nix-prefetch-scripts
|
|
|
|
, coreutils
|
|
|
|
, common-updater-scripts
|
|
|
|
, gnugrep
|
|
|
|
, gnused
|
|
|
|
, curl
|
|
|
|
}:
|
|
|
|
|
|
|
|
{ repoName
|
|
|
|
, attrPath ? repoName
|
|
|
|
, versionPolicy ? "release"
|
|
|
|
}:
|
|
|
|
|
2018-08-20 20:31:18 +00:00
|
|
|
let
|
|
|
|
script = ./update.sh;
|
|
|
|
|
|
|
|
updateScript = runCommand "update.sh" {
|
|
|
|
inherit bash git jq nix coreutils gnugrep gnused curl;
|
|
|
|
# These weren't being substituted
|
|
|
|
nix_prefetch_scripts = nix-prefetch-scripts;
|
|
|
|
common_updater_scripts = common-updater-scripts;
|
|
|
|
} ''
|
|
|
|
substituteAll ${script} $out
|
|
|
|
chmod +x $out
|
|
|
|
'';
|
|
|
|
|
2019-08-05 22:19:01 +00:00
|
|
|
throwFlag = throw "${versionPolicy} is not a valid versionPolicy - Options are either 'release' or 'master' (defaults to release).";
|
|
|
|
|
2019-08-13 21:52:01 +00:00
|
|
|
versionFlag = { release = "-r"; master = "-m"; }.${versionPolicy} or throwFlag;
|
2018-08-20 20:31:18 +00:00
|
|
|
|
|
|
|
in [ updateScript versionFlag repoName attrPath ]
|