Skip to content

Commit

Permalink
nixos/top-level.nix: Make extensible
Browse files Browse the repository at this point in the history
  • Loading branch information
roberth committed Dec 8, 2021
1 parent 9b2af86 commit 4ec415c
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions nixos/modules/system/activation/top-level.nix
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ let
echo -n "${toString config.system.extraDependencies}" > $out/extra-dependencies
${config.system.systemBuilderCommands}
${config.system.extraSystemBuilderCmds}
'';

Expand All @@ -96,7 +98,7 @@ let
# kernel, systemd units, init scripts, etc.) as well as a script
# `switch-to-configuration' that activates the configuration and
# makes it bootable.
baseSystem = pkgs.stdenvNoCC.mkDerivation {
baseSystem = pkgs.stdenvNoCC.mkDerivation ({
name = "nixos-system-${config.system.name}-${config.system.nixos.label}";
preferLocalBuild = true;
allowSubstitutes = false;
Expand All @@ -120,7 +122,7 @@ let

# Needed by switch-to-configuration.
perl = pkgs.perl.withPackages (p: with p; [ FileSlurp NetDBus XMLParser XMLTwig ]);
};
} // config.system.systemBuilderAttrs);

# Handle assertions and warnings

Expand Down Expand Up @@ -228,6 +230,24 @@ in
'';
};

system.systemBuilderCommands = mkOption {
type = types.lines;
internal = true;
default = "";
description = ''
This code will be added to the builder creating the system store path.
'';
};

system.systemBuilderAttrs = mkOption {
type = types.attrsOf types.unspecified;
internal = true;
default = {};
description = ''
Derivation attributes that will be passed to the top level system builder.
'';
};

system.extraSystemBuilderCmds = mkOption {
type = types.lines;
internal = true;
Expand Down

0 comments on commit 4ec415c

Please sign in to comment.