mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 20:39:18 -08:00
Refactor: ..., also: Added vim-lastplace and tmate
This commit is contained in:
parent
386fe7a2c0
commit
46169bc8c2
103 changed files with 142 additions and 167 deletions
|
|
@ -13,13 +13,14 @@ let
|
|||
|
||||
tf = { targetName, target }:
|
||||
tfEval ({ config, ... }: {
|
||||
imports = map (hostName: ../hosts + "/${hostName}/meta.nix") target ++ [{
|
||||
imports = optional (builtins.pathExists ../trusted/tf) (import ../trusted/tf/meta.nix)
|
||||
++ map (hostName: ../hosts + "/${hostName}/meta.nix") target ++ [{
|
||||
config = mkMerge (map (hostName:
|
||||
mapAttrs (_: mkMerge) hosts.${hostName}.config.deploy.tf.out.set)
|
||||
target);
|
||||
}] ++ optional
|
||||
(builtins.pathExists (../private/targets + "/${targetName}"))
|
||||
(../private/targets + "/${targetName}")
|
||||
(builtins.pathExists (../trusted/targets + "/${targetName}"))
|
||||
(../trusted/targets + "/${targetName}")
|
||||
++ optional (builtins.pathExists (../targets + "/${targetName}"))
|
||||
(../targets + "/${targetName}") ++ concatMap (hostName:
|
||||
filter builtins.pathExists
|
||||
|
|
@ -32,10 +33,6 @@ let
|
|||
enable = true;
|
||||
};
|
||||
|
||||
state = {
|
||||
file = ../private/files/tf + "/terraform-${targetName}.tfstate";
|
||||
};
|
||||
|
||||
runners.lazy = {
|
||||
file = ../.;
|
||||
args = [ "--show-trace" ];
|
||||
|
|
@ -44,11 +41,6 @@ let
|
|||
in "deploy.${attr}.runners.run.";
|
||||
};
|
||||
|
||||
terraform = {
|
||||
dataDir = ../private/files/tf + "/tfdata/${targetName}";
|
||||
logPath = ../private/files/tf + "/terraform-${targetName}.log";
|
||||
};
|
||||
|
||||
variables.hcloud_token = {
|
||||
type = "string";
|
||||
value.shellCommand = "bitw get infra/hcloud_token";
|
||||
|
|
@ -76,6 +68,10 @@ let
|
|||
key_algorithm = "hmac-sha512";
|
||||
};
|
||||
};
|
||||
|
||||
_module.args = {
|
||||
inherit targetName;
|
||||
};
|
||||
});
|
||||
in {
|
||||
inherit tf;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue