mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
project-wide: Correctness
This commit is contained in:
parent
69c2dcf7f2
commit
1868690888
1 changed files with 7 additions and 7 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs, hosts, sources, groups, group ? "all", host ? null}:
|
{ pkgs, hosts, sources, groups }:
|
||||||
|
|
||||||
with pkgs.lib;
|
with pkgs.lib;
|
||||||
|
|
||||||
|
|
@ -11,10 +11,10 @@ let
|
||||||
specialArgs = { };
|
specialArgs = { };
|
||||||
}).config;
|
}).config;
|
||||||
|
|
||||||
tf = tfEval ({ config, ... }: {
|
tf = makeOverridable ({ group ? null, host ? null }: tfEval ({ config, ... }: {
|
||||||
deps = {
|
deps = {
|
||||||
enable = true;
|
enable = true;
|
||||||
select.hclPaths = (map (name: config.resources."${name}_system_switch".out.hclPathStr) (if host != null then [ host ] else groups.${group} ));
|
select.hclPaths = (map (name: config.resources."${name}_system_switch".out.hclPathStr) (if host != null then [ host ] else (if group != null then groups.${group} else []) ));
|
||||||
};
|
};
|
||||||
|
|
||||||
state = { file = toString ../private/files/tf/terraform.tfstate; };
|
state = { file = toString ../private/files/tf/terraform.tfstate; };
|
||||||
|
|
@ -22,7 +22,7 @@ let
|
||||||
runners.lazy = {
|
runners.lazy = {
|
||||||
file = ../.;
|
file = ../.;
|
||||||
args = [ "--show-trace" ];
|
args = [ "--show-trace" ];
|
||||||
attrPrefix = let attr = if host != null then "host.${host}" else "group.${group}"; in "deploy.${attr}.runners.run.";
|
attrPrefix = let attr = if host != null then "host.${host}" else if group != null then "group.${group}" else "tf"; in "deploy.${attr}.runners.run.";
|
||||||
};
|
};
|
||||||
|
|
||||||
terraform = {
|
terraform = {
|
||||||
|
|
@ -95,9 +95,9 @@ let
|
||||||
triggers.copy.yule = athame.refAttr "id";
|
triggers.copy.yule = athame.refAttr "id";
|
||||||
triggers.secrets.yule = athame.refAttr "id";
|
triggers.secrets.yule = athame.refAttr "id";
|
||||||
};
|
};
|
||||||
});
|
})) {};
|
||||||
in {
|
in {
|
||||||
inherit tf;
|
inherit tf;
|
||||||
group = genAttrs (attrNames groups) (group: (import ./deploy.nix { inherit pkgs hosts sources groups group; }).tf);
|
group = genAttrs (attrNames groups) (group: (tf.override { inherit group; }));
|
||||||
host = genAttrs (attrNames hosts) (host: (import ./deploy.nix { inherit pkgs hosts sources groups host; }).tf);
|
host = genAttrs (attrNames hosts) (host: (tf.override { inherit host; }));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue