project-wide: Working DNS setup + referencing tf.nix from hostConfig

This commit is contained in:
kat witch 2021-03-30 02:58:10 +01:00
parent 92c12dd991
commit 2eb84e4654
No known key found for this signature in database
GPG key ID: 1B477797DCA5EC72
6 changed files with 43 additions and 9 deletions

View file

@ -15,9 +15,10 @@ let
tfEval ({ config, ... }: {
imports =
mapAttrsToList (name: host: import (../hosts + "/${name}/meta.nix"))
hosts;
hosts ++ [{ config = mkMerge (mapAttrsToList (_: host: mapAttrs (_: mkMerge) host.config.deploy.tf.out.set) hosts); }];
deps = {
deps = {
select.allProviders = true;
enable = true;
select.hclPaths =
(map (name: config.resources."${name}_system_switch".out.hclPathStr)
@ -62,11 +63,13 @@ let
value.shellCommand = "bitw get infra/rfc2136 -f password";
};
dns.zones."kittywit.ch." = { provider = "dns"; };
providers.hcloud = { inputs.token = config.variables.hcloud_token.ref; };
providers.dns = {
inputs.update = {
server = "45.129.95.255";
server = "ns1.as207960.net";
key_name = config.variables.glauca_key.ref;
key_secret = config.variables.glauca_secret.ref;
key_algorithm = "hmac-sha512";

View file

@ -1,4 +1,4 @@
{ pkgs, hostsDir ? ../hosts, profiles, pkgsPath ? ../pkgs, sources ? { }
{ pkgs, tf, hostsDir ? ../hosts, profiles, pkgsPath ? ../pkgs, sources ? { }
, witch ? { } }:
with pkgs.lib;
@ -27,7 +27,7 @@ rec {
else
{ })
];
specialArgs = { inherit sources profiles witch hostName; };
specialArgs = { inherit sources tf profiles witch hostName; };
})) hostNames);
groupNames = unique (concatLists