diff --git a/pkgs/by-name/de/den-http-get-updater/package.nix b/pkgs/by-name/de/den-http-get-updater/package.nix index b6ba547..484fa35 100644 --- a/pkgs/by-name/de/den-http-get-updater/package.nix +++ b/pkgs/by-name/de/den-http-get-updater/package.nix @@ -23,6 +23,8 @@ # }; # prefetchHash: string?; # targetHash: string?; + # unpack: bool?; + # name: string?; # }[] # prefetchList ? [], @@ -38,7 +40,6 @@ unpack ? true, hashAlgo ? "sha256", hashFormat ? "sri", - name ? if unpack then "source" else null, }: let @@ -52,7 +53,8 @@ let ); assert lib.isAttrs x.prefetchUrlLocation && lib.isString x.prefetchUrlLocation.attrpath or null; rec { - inherit fileLocation hashAlgo hashFormat; + inherit fileLocation hashAlgo hashFormat unpack; + name = if x.unpack or unpack then "source" else null; mark = builtins.hashString "sha256" x.previousHash; markRegexEscape = lib.escapeRegex mark; realFileLocation = builtins.toString x.fileLocation or fileLocation; @@ -66,8 +68,6 @@ let previousVersionRegexEscape = lib.escapeRegex previousVersion; - nixUnpack = lib.optionalString unpack "--unpack"; - nixName = lib.optionalString (!builtins.isNull name) "--name \"${lib.escapeShellArg name}\""; path = lib.makeBinPath ([ curl @@ -104,10 +104,15 @@ writeScript "den-http-get-updater" ('' + lib.concatStringsSep "\n" (lib.map ({ fileLocation, markRegexEscape, + name, prefetchUrlLocationShellEscape, realFileLocationShellEscape, + unpack, ... -}: '' +}: let + nixUnpack = lib.optionalString unpack "--unpack"; + nixName = lib.optionalString (!builtins.isNull name) "--name \"${lib.escapeShellArg name}\""; +in '' nixUrlsResult=$(nix-instantiate --eval --json --strict \ "${prefetchUrlLocationShellEscape.file}" \ -A "${prefetchUrlLocationShellEscape.attrpath}"