flake.nix: support list-type updateScripts (e.g. `nix-update-script {}`)

This commit is contained in:
Colin 2023-09-27 19:09:29 +00:00
parent bc9bacb08f
commit 387b49a8b5
1 changed files with 2 additions and 1 deletions

View File

@ -271,7 +271,8 @@
program = let
pkg = pkgs.lib.getAttrFromPath attrPath sanePkgs;
strAttrPath = pkgs.lib.concatStringsSep "." attrPath;
command = pkgs.lib.escapeShellArgs pkg.updateScript.command;
commandArgv = pkg.updateScript.command or pkg.updateScript;
command = pkgs.lib.escapeShellArgs commandArgv;
in builtins.toString (pkgs.writeShellScript "update-${strAttrPath}" ''
export UPDATE_NIX_NAME=${pkg.name}
export UPDATE_NIX_PNAME=${pkg.pname}