diff --git a/pkgs/build-support/trivial-builders/default.nix b/pkgs/build-support/trivial-builders/default.nix index b0c9f93649c9..c5b27e85e5bb 100644 --- a/pkgs/build-support/trivial-builders/default.nix +++ b/pkgs/build-support/trivial-builders/default.nix @@ -82,6 +82,7 @@ rec { , destination ? "" , checkPhase ? "" , meta ? { } + , passthru ? { } , allowSubstitutes ? false , preferLocalBuild ? true , derivationArgs ? { } @@ -105,7 +106,8 @@ rec { { mainProgram = lib.head matches; } // meta // derivationArgs.meta or {}; - } // removeAttrs derivationArgs [ "passAsFile" "meta" ]) + passthru = passthru // derivationArgs.passthru or {}; + } // removeAttrs derivationArgs [ "passAsFile" "meta" "passthru" ]) '' target=$out${lib.escapeShellArg destination} mkdir -p "$(dirname "$target")" @@ -220,6 +222,12 @@ rec { Type: AttrSet */ meta ? { }, + /* + `stdenv.mkDerivation`'s `passthru` argument. + + Type: AttrSet + */ + passthru ? { }, /* The `checkPhase` to run. Defaults to `shellcheck` on supported platforms and `bash -n`. @@ -263,7 +271,7 @@ rec { derivationArgs ? { }, }: writeTextFile { - inherit name meta derivationArgs; + inherit name meta passthru derivationArgs; executable = true; destination = "/bin/${name}"; allowSubstitutes = true; @@ -366,9 +374,10 @@ rec { , destination ? "" # relative path appended to $out eg "/bin/foo" , checkPhase ? "" # syntax checks, e.g. for scripts , meta ? { } + , passthru ? { } }: runCommandLocal name - { inherit files executable checkPhase meta destination; } + { inherit files executable checkPhase meta passthru destination; } '' file=$out$destination mkdir -p "$(dirname "$file")"