modules/nixos/tf-glue: Automatic per-host deploy settings

This commit is contained in:
kat witch 2021-04-28 20:53:17 +01:00
parent 93a341b16f
commit 9b122408c0
No known key found for this signature in database
GPG key ID: 1B477797DCA5EC72
6 changed files with 11 additions and 30 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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