Added Thingvellir nomad volumes

This commit is contained in:
marc
2024-02-16 20:37:07 +01:00
parent 87a4d79c71
commit 2e3dad1c1b
3 changed files with 46 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
{
"client": {
"host_network": {
"public": {
"interface": "ens3",
"reserved_ports": "80,443,2222"
}
},
"host_volume": {
"dns-unbound": {
"path": "/var/lib/nomad_volumes/dns/unbound",
"read_only": false
},
"dns-pihole": {
"path": "/var/lib/nomad_volumes/dns/pihole/etc-pihole",
"read_only": false
},
"dns-dnsmasq": {
"path": "/var/lib/nomad_volumes/dns/pihole/etc-dnsmasq.d",
"read_only": false
},
"caddyfile": {
"path": "/var/lib/nomad_volumes/caddy/Caddyfile",
"read_only": false
},
"caddy-data": {
"path": "/var/lib/nomad_volumes/caddy/data",
"read_only": false
}
}
}
}

View File

@@ -53,6 +53,7 @@ with lib;
server.nomad = { server.nomad = {
enable = true; enable = true;
server = true; server = true;
host-config = ../../config/nomad.d/host-thingvellir.json;
}; };
# - Editors and development ------------------ # - Editors and development ------------------

View File

@@ -13,6 +13,12 @@ in
description = "Set to true if configured a server - otherwise a client is assumed"; description = "Set to true if configured a server - otherwise a client is assumed";
}; };
host-config = lib.mkOption {
type = lib.types.nullOr lib.types.path;
default = null;
description = "Additional host-specific config file";
};
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
# services.consul.enable = true; # services.consul.enable = true;
@@ -45,6 +51,12 @@ in
target = "nomad.d/server.json"; target = "nomad.d/server.json";
source = ../../config/nomad.d/server.json; source = ../../config/nomad.d/server.json;
}; };
} // lib.optionalAttrs cfg.host-config {
# Host-specific configuration
nomad-host-cfg = {
target = "nomad.d/host.json";
source = cfg.host-config;
};
}; };
age.secrets = { age.secrets = {