dockerTools.streamLayeredImage: add includeNixDB argument, expose conf and streamScript

This commit is contained in:
Yorick van Pelt 2024-05-03 16:40:48 +02:00
parent f945939fd6
commit c055845069
No known key found for this signature in database
GPG Key ID: D8D3CC6D951384DE

View File

@ -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