mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-13 20:30:02 +00:00
Add system.systemBuilderCommands and systemBuilderArgs
These are the equivalents of the
NixOS options with the same name, introduced in
d3ac0938a7
.
Allows running extra commands while building the system configuration
output, for example to add extra files into the output directory,
and passing arguments to the system builder's mkDerivation.
This commit is contained in:
parent
97d4a91029
commit
b70656affa
1 changed files with 22 additions and 2 deletions
|
@ -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)));
|
||||
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue