diff --git a/pkgs/build-support/docker/default.nix b/pkgs/build-support/docker/default.nix index 0583f522bda3..de081d709f9f 100644 --- a/pkgs/build-support/docker/default.nix +++ b/pkgs/build-support/docker/default.nix @@ -911,6 +911,8 @@ rec { , fakeRootCommands ? "" , enableFakechroot ? false , includeStorePaths ? true + # Generate a Nix DB inside the image. The same caveats as `buildImageWithNixDb` apply. + , includeNixDB ? false , passthru ? {} , }: @@ -941,7 +943,9 @@ rec { customisationLayer = symlinkJoin { name = "${baseName}-customisation-layer"; paths = contentsList; - inherit extraCommands fakeRootCommands; + extraCommands = + (lib.optionalString includeNixDB (mkDbExtraCommand contents)) + extraCommands; + inherit fakeRootCommands; nativeBuildInputs = [ fakeroot ] ++ optionals enableFakechroot [ @@ -1094,7 +1098,9 @@ rec { result = runCommand "stream-${baseName}" { + inherit conf; inherit (conf) imageName; + inherit streamScript; preferLocalBuild = true; passthru = passthru // { inherit (conf) imageTag; @@ -1105,7 +1111,7 @@ rec { }; nativeBuildInputs = [ makeWrapper ]; } '' - makeWrapper ${streamScript} $out --add-flags ${conf} + makeWrapper $streamScript $out --add-flags $conf ''; in result