Compare commits

...

2 commits

Author SHA1 Message Date
45a9ced99b lock: update 2025-04-09 12:54:27 +02:00
80cb27a618 pkgs/den-http-get-updater: try evaluate urlLocation multiple times 2025-04-09 12:54:16 +02:00
2 changed files with 19 additions and 8 deletions

View file

@ -8,11 +8,11 @@
sha256 = "sha256-o4FjFOUmjSRMK7dn0TFdAT0RRWUWD+WsspPHa+qEQT8="; sha256 = "sha256-o4FjFOUmjSRMK7dn0TFdAT0RRWUWD+WsspPHa+qEQT8=";
}; };
nixpkgs-unstable = { nixpkgs-unstable = {
revision = "063dece00c5a77e4a0ea24e5e5a5bd75232806f8"; revision = "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7";
sha256 = "sha256-nEo1t3Q0F+0jQ36HJfbJtiRU4OI+/0jX/iITURKe3EE="; sha256 = "sha256-tzCdyIJj9AjysC3OuKA+tMD/kDEDAF9mICPDU7ix0JA=";
}; };
cosmic-modules = { cosmic-modules = {
revision = "14411c86d9af8e654e5a1608cc891e4e26f07b2f"; revision = "d20b15f629985fe6900925bef462f947e4a75b2f";
sha256 = "sha256-TjRL6QnmOc3tXEJxkH/ThLem8R4g8YsGzAbvoDMW2Q4="; sha256 = "sha256-KEuKL7lM2ZqKzvaGIptVDAce29CAR4ZSgWtFD3PnpB0=";
}; };
} }

View file

@ -113,10 +113,21 @@ writeScript "den-http-get-updater" (''
nixUnpack = lib.optionalString unpack "--unpack"; nixUnpack = lib.optionalString unpack "--unpack";
nixName = lib.optionalString (!builtins.isNull name) "--name \"${lib.escapeShellArg name}\""; nixName = lib.optionalString (!builtins.isNull name) "--name \"${lib.escapeShellArg name}\"";
in '' in ''
nixUrlsResult=$(nix-instantiate --eval --json --strict \ for i in {{ 1..30 }}; do
"${prefetchUrlLocationShellEscape.file}" \ nixUrlsResult=$(nix-instantiate --eval --json --strict \
-A "${prefetchUrlLocationShellEscape.attrpath}" "${prefetchUrlLocationShellEscape.file}" \
) -A "${prefetchUrlLocationShellEscape.attrpath}"
)
if [[ "$?" == "0" ]]; then
break
elif [[ "$i" == 30 ]]; then
echo "error: prefetchUrlLocation failed - attempts exhausted" 1>&2
exit 1
fi
echo "prefetchUrlLocation failed (attempt $i)" 1>&2
sleep 2
done
urlsType=$(jq -rc 'type' <<< "$nixUrlsResult") urlsType=$(jq -rc 'type' <<< "$nixUrlsResult")
if [ "$urlsType" = "array" ]; then if [ "$urlsType" = "array" ]; then