Refactor: ..., also: Added vim-lastplace and tmate

This commit is contained in:
kat witch 2021-05-07 00:49:01 +01:00
parent 386fe7a2c0
commit 46169bc8c2
No known key found for this signature in database
GPG key ID: 1B477797DCA5EC72
103 changed files with 142 additions and 167 deletions

View file

@ -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;