trivial-builders: add missing passthru argument (#320973)

This commit is contained in:
Jonas Chevalier 2024-11-02 21:26:26 +01:00 committed by GitHub
commit b508b87938
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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