nixos/modules/locations.nix
Jake Hillion 348bca745b
All checks were successful
flake / flake (push) Successful in 1m44s
jorah: add authoritative dns server
2024-04-27 18:54:46 +01:00

46 lines
1.1 KiB
Nix

{ config, lib, ... }:
let
cfg = config.custom.locations;
in
{
options.custom.locations = {
autoServe = lib.mkOption {
default = false;
type = lib.types.bool;
};
locations = lib.mkOption {
readOnly = true;
default = {
services = {
authoritative_dns = [
"jorah.cx.ts.hillion.co.uk"
];
downloads = "tywin.storage.ts.hillion.co.uk";
gitea = "jorah.cx.ts.hillion.co.uk";
homeassistant = "microserver.home.ts.hillion.co.uk";
mastodon = "";
matrix = "jorah.cx.ts.hillion.co.uk";
tang = [
"li.pop.ts.hillion.co.uk"
"microserver.home.ts.hillion.co.uk"
];
unifi = "jorah.cx.ts.hillion.co.uk";
};
};
};
};
config = lib.mkIf cfg.autoServe {
custom.services = lib.mapAttrsRecursive
(path: value: {
enable =
if builtins.isList value
then builtins.elem config.networking.fqdn value
else config.networking.fqdn == value;
})
cfg.locations.services;
};
}