aboutsummaryrefslogtreecommitdiff
path: root/nix/deuxfleurs.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nix/deuxfleurs.nix')
-rw-r--r--nix/deuxfleurs.nix24
1 files changed, 16 insertions, 8 deletions
diff --git a/nix/deuxfleurs.nix b/nix/deuxfleurs.nix
index a83dda4..28161dc 100644
--- a/nix/deuxfleurs.nix
+++ b/nix/deuxfleurs.nix
@@ -90,6 +90,10 @@ in
description = "Site (availability zone) on which this node is deployed";
type = types.str;
};
+ cname_target = mkOption {
+ description = "DNS CNAME target to use for services hosted in this site, for domain names that are updated by DiploNAT";
+ type = types.nullOr types.str;
+ };
nameservers = mkOption {
description = "External DNS servers to use";
type = types.listOf types.str;
@@ -124,7 +128,16 @@ in
};
};
- config = {
+ config =
+ let node_meta = {
+ "site" = cfg.site_name;
+ "public_ipv6" = cfg.ipv6;
+ } //
+ (if cfg.cname_target != null
+ then { "cname_target" = cfg.cname_target; }
+ else {});
+ in
+ {
# Configure admin accounts on all nodes
users.users = builtins.mapAttrs (name: publicKeys: {
isNormalUser = true;
@@ -240,10 +253,8 @@ in
// (if cfg.bootstrap then { bootstrap_expect = 3; } else {})
else {}) //
{
+ inherit node_meta;
datacenter = cfg.cluster_name;
- node_meta = {
- "site" = cfg.site_name;
- };
ui_config = {
enabled = true;
};
@@ -304,10 +315,7 @@ in
client = {
enabled = true;
network_interface = "wg0";
- meta = {
- "site" = cfg.site_name;
- "public_ipv6" = cfg.ipv6;
- };
+ meta = node_meta;
};
telemetry = {
publish_allocation_metrics = true;