File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 716716 ) ;
717717
718718 let
719- envIsExportable = isAttrs env && ! isDerivation env ;
719+ mainProgram = meta . mainProgram or null ;
720+ env' = env // lib . optionalAttrs ( mainProgram != null ) { NIX_MAIN_PROGRAM = mainProgram ; } ;
721+ envIsExportable = isAttrs env' && ! isDerivation env' ;
720722
721723 derivationArg = makeDerivationArgument (
722724 removeAttrs attrs (
@@ -746,11 +748,11 @@ let
746748
747749 checkedEnv =
748750 let
749- overlappingNames = attrNames ( builtins . intersectAttrs env derivationArg ) ;
751+ overlappingNames = attrNames ( builtins . intersectAttrs env' derivationArg ) ;
750752 prettyPrint = lib . generators . toPretty { } ;
751753 makeError =
752754 name :
753- " - ${ name } : in `env`: ${ prettyPrint env . ${ name } } ; in derivation arguments: ${
755+ " - ${ name } : in `env`: ${ prettyPrint env' . ${ name } } ; in derivation arguments: ${
754756 prettyPrint derivationArg . ${ name }
755757 } " ;
756758 errors = lib . concatMapStringsSep "\n " makeError overlappingNames ;
764766 assert assertMsg ( isString v || isBool v || isInt v || isDerivation v )
765767 "The `env` attribute set can only contain derivation, string, boolean or integer attributes. The `${ n } ` attribute is of type ${ builtins . typeOf v } ." ;
766768 v
767- ) env ;
769+ ) env' ;
768770
769771 # Fixed-output derivations may not reference other paths, which means that
770772 # for a fixed-output derivation, the corresponding inputDerivation should
You can’t perform that action at this time.
0 commit comments