diff options
| author | Marco Rebhan <me@dblsaiko.net> | 2022-12-05 21:27:01 +0100 |
|---|---|---|
| committer | Marco Rebhan <me@dblsaiko.net> | 2023-07-10 16:05:55 +0200 |
| commit | b70656affa5e63efcf0a0a728c6f9a26911c7ef4 (patch) | |
| tree | 591b785df5504333eed46de64bb2f5160eb0a3f0 /modules/system/default.nix | |
| parent | 97d4a9102964aae7deac3290d755e6fbad9b94ab (diff) | |
Add system.systemBuilderCommands and systemBuilderArgs
These are the equivalents of the
NixOS options with the same name, introduced in
https://github.com/NixOS/nixpkgs/commit/d3ac0938a7a0ce6455fc580f16eb7476cca87dc6.
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.
Diffstat (limited to 'modules/system/default.nix')
| -rw-r--r-- | modules/system/default.nix | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/modules/system/default.nix b/modules/system/default.nix index 58369a8..af90ada 100644 --- a/modules/system/default.nix +++ b/modules/system/default.nix @@ -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))); }; } |
