1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-13 20:30:02 +00:00

Merge pull request #577 from 2xsaiko/outgoing/systembuildercommands

Add system.systemBuilderCommands and systemBuilderArgs
This commit is contained in:
Michael Hoang 2023-07-11 00:30:59 +10:00 committed by GitHub
commit 83620edf49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -43,6 +43,24 @@ in
'';
};
system.systemBuilderCommands = mkOption {
internal = true;
type = types.lines;
default = "";
description = ''
This code will be added to the builder creating the system store path.
'';
};
system.systemBuilderArgs = mkOption {
internal = true;
type = types.attrsOf types.unspecified;
default = {};
description = lib.mdDoc ''
`lib.mkDerivation` attributes that will be passed to the top level system builder.
'';
};
assertions = mkOption {
type = types.listOf types.unspecified;
internal = true;
@ -70,7 +88,7 @@ in
config = {
system.build.toplevel = throwAssertions (showWarnings (stdenvNoCC.mkDerivation {
system.build.toplevel = throwAssertions (showWarnings (stdenvNoCC.mkDerivation ({
name = "darwin-system-${cfg.darwinLabel}";
preferLocalBuild = true;
@ -113,8 +131,10 @@ in
echo -n "$darwinLabel" > $out/darwin-version
echo -n "$system" > $out/system
${cfg.systemBuilderCommands}
'';
}));
} // cfg.systemBuilderArgs)));
};
}