machine/vars: expose result direclty via vars submodule; keep deployment.data alias for now
This commit is contained in:
@@ -35,35 +35,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
config.system.clan.deployment.data = {
|
config.system.clan.deployment.data = {
|
||||||
vars = {
|
vars = config.clan.core.vars._serialized;
|
||||||
generators = lib.flip lib.mapAttrs config.clan.core.vars.generators (
|
|
||||||
_name: generator: {
|
|
||||||
inherit (generator)
|
|
||||||
name
|
|
||||||
dependencies
|
|
||||||
validationHash
|
|
||||||
migrateFact
|
|
||||||
share
|
|
||||||
prompts
|
|
||||||
;
|
|
||||||
|
|
||||||
files = lib.flip lib.mapAttrs generator.files (
|
|
||||||
_name: file: {
|
|
||||||
inherit (file)
|
|
||||||
name
|
|
||||||
owner
|
|
||||||
group
|
|
||||||
mode
|
|
||||||
deploy
|
|
||||||
secret
|
|
||||||
neededFor
|
|
||||||
;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
inherit (config.clan.core.vars.settings) secretModule publicModule;
|
|
||||||
};
|
|
||||||
inherit (config.clan.core.networking) targetHost buildHost;
|
inherit (config.clan.core.networking) targetHost buildHost;
|
||||||
inherit (config.clan.core.deployment) requireExplicitUpdate;
|
inherit (config.clan.core.deployment) requireExplicitUpdate;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -33,6 +33,50 @@ let
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
|
_serialized = lib.mkOption {
|
||||||
|
readOnly = true;
|
||||||
|
internal = true;
|
||||||
|
description = ''
|
||||||
|
JSON serialization of the generators.
|
||||||
|
This is read from the python client to generate the specified ressources.
|
||||||
|
'';
|
||||||
|
default = {
|
||||||
|
# TODO: We don't support per-machine choice of backends
|
||||||
|
# Configuring different backend doesn't work, this information should be made read only and configured
|
||||||
|
# Via clan.settings instead.
|
||||||
|
inherit (config.settings) secretModule publicModule;
|
||||||
|
# Serialize generators, so that we can use them in the python client
|
||||||
|
# This need to be done because we have some non-serializable values in the generators
|
||||||
|
# Like the finalScript (derivation) or pkgs.
|
||||||
|
generators = lib.flip lib.mapAttrs config.generators (
|
||||||
|
_name: generator: {
|
||||||
|
inherit (generator)
|
||||||
|
name
|
||||||
|
dependencies
|
||||||
|
validationHash
|
||||||
|
migrateFact
|
||||||
|
share
|
||||||
|
prompts
|
||||||
|
;
|
||||||
|
|
||||||
|
files = lib.flip lib.mapAttrs generator.files (
|
||||||
|
_name: file: {
|
||||||
|
inherit (file)
|
||||||
|
name
|
||||||
|
owner
|
||||||
|
group
|
||||||
|
mode
|
||||||
|
deploy
|
||||||
|
secret
|
||||||
|
neededFor
|
||||||
|
;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
settings = import ./settings-opts.nix { inherit lib; };
|
settings = import ./settings-opts.nix { inherit lib; };
|
||||||
generators = lib.mkOption {
|
generators = lib.mkOption {
|
||||||
description = ''
|
description = ''
|
||||||
|
|||||||
Reference in New Issue
Block a user