diff --git a/hosts/athame/meta.nix b/hosts/athame/meta.nix index b8b7c1d2..997b7ad5 100644 --- a/hosts/athame/meta.nix +++ b/hosts/athame/meta.nix @@ -90,15 +90,11 @@ with config.resources; { # cname.target = "athame.kittywit.ch."; #}; - deploy.systems.athame = { - nixosConfig = hosts.athame.config; - connection = athame.connection.set; # connection = { # host = athame.refAttr "ipv4_address"; # port = 62954; # }; - triggers.copy.athame = athame.refAttr "id"; - triggers.secrets.athame = athame.refAttr "id"; + #triggers.switch = lib.mapAttrs (name: record: # { # A = config.lib.tf.terraformExpr @@ -108,5 +104,5 @@ with config.resources; { # CNAME = record.out.resource.refAttr "cname"; # SRV = record.out.resource.refAttr "id"; # }.${record.out.type}) config.dns.records; - }; + } diff --git a/hosts/mabon/meta.nix b/hosts/mabon/meta.nix index 0e47ee5d..fc692061 100644 --- a/hosts/mabon/meta.nix +++ b/hosts/mabon/meta.nix @@ -8,11 +8,5 @@ host = "192.168.1.119"; }; }; - deploy.systems.mabon = with config.resources; { - nixosConfig = hosts.mabon.config; - connection = mabon.connection.set; - triggers.copy.mabon = mabon.refAttr "id"; - triggers.secrets.mabon = mabon.refAttr "id"; - }; }; } diff --git a/hosts/ostara/meta.nix b/hosts/ostara/meta.nix index 2249c3f9..0669f51c 100644 --- a/hosts/ostara/meta.nix +++ b/hosts/ostara/meta.nix @@ -8,11 +8,5 @@ host = "192.168.1.245"; }; }; - deploy.systems.ostara = with config.resources; { - nixosConfig = hosts.ostara.config; - connection = ostara.connection.set; - triggers.copy.ostara = ostara.refAttr "id"; - triggers.secrets.ostara = ostara.refAttr "id"; - }; }; } diff --git a/hosts/samhain/meta.nix b/hosts/samhain/meta.nix index 4bb3adbb..53d2ee81 100644 --- a/hosts/samhain/meta.nix +++ b/hosts/samhain/meta.nix @@ -8,11 +8,5 @@ host = "192.168.1.135"; }; }; - deploy.systems.samhain = with config.resources; { - nixosConfig = hosts.samhain.config; - connection = samhain.connection.set; - triggers.copy.samhain = samhain.refAttr "id"; - triggers.secrets.samhain = samhain.refAttr "id"; - }; }; } diff --git a/hosts/yule/meta.nix b/hosts/yule/meta.nix index d58cb247..c7544f33 100644 --- a/hosts/yule/meta.nix +++ b/hosts/yule/meta.nix @@ -8,11 +8,5 @@ host = "192.168.1.92"; }; }; - deploy.systems.yule = with config.resources; { - nixosConfig = hosts.yule.config; - connection = yule.connection.set; - triggers.copy.yule = yule.refAttr "id"; - triggers.secrets.yule = yule.refAttr "id"; - }; }; } diff --git a/modules/nixos/tf-glue/default.nix b/modules/nixos/tf-glue/default.nix index be469f1e..9f5de450 100644 --- a/modules/nixos/tf-glue/default.nix +++ b/modules/nixos/tf-glue/default.nix @@ -26,6 +26,15 @@ in { attrs = [ "out" "attrs" ]; out.set = removeAttrs cfg cfg.attrs; }; + + deploy.tf.deploy.systems."${config.networking.hostName}" = with tf.resources; { + isRemote = false; + nixosConfig = config; + connection = tf.resources.${config.networking.hostName}.connection.set; + triggers.copy."${config.networking.hostName}" = tf.resources.${config.networking.hostName}.refAttr "id"; + triggers.secrets."${config.networking.hostName}" = tf.resources.${config.networking.hostName}.refAttr "id"; + }; + deploy.tf.dns.records."kittywitch_net_${config.networking.hostName}" = mkIf (config.hexchen.network.enable) { tld = "kittywit.ch.";