aboutsummaryrefslogtreecommitdiff
path: root/nix/deuxfleurs.nix
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-12-07 12:32:21 +0100
committerAlex Auvolat <alex@adnab.me>2022-12-07 12:32:21 +0100
commitab97a7bffd9b369bb55220b4542de3ccddda5803 (patch)
tree28e531bdee2fc1614c9e49c99eb357b0c03ae9dc /nix/deuxfleurs.nix
parent1d4599fc1c7cd783c6c2857194276eb1f5513ba6 (diff)
downloadnixcfg-ab97a7bffd9b369bb55220b4542de3ccddda5803.tar.gz
nixcfg-ab97a7bffd9b369bb55220b4542de3ccddda5803.zip
Staging: Add CNAME target meta parameter, will be used for diplonat auto dns update
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;