8282 , destination ? ""
8383 , checkPhase ? ""
8484 , meta ? { }
85+ , passthru ? { }
8586 , allowSubstitutes ? false
8687 , preferLocalBuild ? true
8788 , derivationArgs ? { }
@@ -105,7 +106,8 @@ rec {
105106 {
106107 mainProgram = lib . head matches ;
107108 } // meta // derivationArgs . meta or { } ;
108- } // removeAttrs derivationArgs [ "passAsFile" "meta" ] )
109+ passthru = passthru // derivationArgs . passthru or { } ;
110+ } // removeAttrs derivationArgs [ "passAsFile" "meta" "passthru" ] )
109111 ''
110112 target=$out${ lib . escapeShellArg destination }
111113 mkdir -p "$(dirname "$target")"
@@ -220,6 +222,12 @@ rec {
220222 Type: AttrSet
221223 */
222224 meta ? { } ,
225+ /*
226+ `stdenv.mkDerivation`'s `passthru` argument.
227+
228+ Type: AttrSet
229+ */
230+ passthru ? { } ,
223231 /*
224232 The `checkPhase` to run. Defaults to `shellcheck` on supported
225233 platforms and `bash -n`.
@@ -263,7 +271,7 @@ rec {
263271 derivationArgs ? { } ,
264272 } :
265273 writeTextFile {
266- inherit name meta derivationArgs ;
274+ inherit name meta passthru derivationArgs ;
267275 executable = true ;
268276 destination = "/bin/${ name } " ;
269277 allowSubstitutes = true ;
@@ -366,9 +374,10 @@ rec {
366374 , destination ? "" # relative path appended to $out eg "/bin/foo"
367375 , checkPhase ? "" # syntax checks, e.g. for scripts
368376 , meta ? { }
377+ , passthru ? { }
369378 } :
370379 runCommandLocal name
371- { inherit files executable checkPhase meta destination ; }
380+ { inherit files executable checkPhase meta passthru destination ; }
372381 ''
373382 file=$out$destination
374383 mkdir -p "$(dirname "$file")"
0 commit comments