Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/nix/hive/eval.nix
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ in rec {
__schema = "v0.5";

nodes = listToAttrs (map (name: { inherit name; value = evalNode name (configsFor name); }) nodeNames);
toplevel = lib.mapAttrs (_: v: v.config.system.build.toplevel) nodes;
toplevel = lib.mapAttrs (name: node: let targetImage = deploymentConfig.${name}.targetImage; in if targetImage == null then node.config.system.build.toplevel else node.config.system.build.images.${targetImage}.passthru.config.system.build.toplevel) nodes;
deploymentConfig = lib.mapAttrs (_: v: v.config.deployment) nodes;
deploymentConfigSelected = names: lib.filterAttrs (name: _: elem name names) deploymentConfig;
evalSelected = names: lib.filterAttrs (name: _: elem name names) toplevel;
Expand Down
7 changes: 7 additions & 0 deletions src/nix/hive/options.nix
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ with builtins; rec {
type = types.nullOr types.str;
default = "root";
};
targetImage = lib.mkOption {
description = ''
The image (from system.build.images.<targetImage>) to deploy on the target.
'';
type = types.nullOr types.str;
default = null;
};
allowLocalDeployment = lib.mkOption {
description = ''
Allow the configuration to be applied locally on the host running
Expand Down
Loading