2023-04-29 19:20:42 +01:00
|
|
|
{ config, lib, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.custom.locations;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.custom.locations = {
|
|
|
|
autoServe = lib.mkOption {
|
|
|
|
default = false;
|
|
|
|
type = lib.types.bool;
|
|
|
|
};
|
|
|
|
|
|
|
|
locations = lib.mkOption {
|
2024-04-27 17:06:20 +01:00
|
|
|
readOnly = true;
|
2024-04-28 10:39:07 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkMerge [
|
|
|
|
{
|
|
|
|
custom.locations.locations = {
|
2023-04-29 19:20:42 +01:00
|
|
|
services = {
|
2024-05-21 22:38:26 +01:00
|
|
|
authoritative_dns = [ "boron.cx.ts.hillion.co.uk" ];
|
2023-03-18 22:41:29 +00:00
|
|
|
downloads = "tywin.storage.ts.hillion.co.uk";
|
2024-05-12 11:33:08 +01:00
|
|
|
gitea = "boron.cx.ts.hillion.co.uk";
|
2023-12-24 22:09:53 +00:00
|
|
|
homeassistant = "microserver.home.ts.hillion.co.uk";
|
2024-04-07 19:06:46 +01:00
|
|
|
mastodon = "";
|
2024-05-18 18:52:16 +01:00
|
|
|
matrix = "boron.cx.ts.hillion.co.uk";
|
2024-04-22 20:49:43 +01:00
|
|
|
tang = [
|
|
|
|
"li.pop.ts.hillion.co.uk"
|
|
|
|
"microserver.home.ts.hillion.co.uk"
|
2024-06-10 21:29:21 +01:00
|
|
|
"sodium.pop.ts.hillion.co.uk"
|
2024-04-22 20:49:43 +01:00
|
|
|
];
|
2024-05-18 16:41:53 +01:00
|
|
|
unifi = "boron.cx.ts.hillion.co.uk";
|
2024-05-21 22:38:26 +01:00
|
|
|
version_tracker = [ "boron.cx.ts.hillion.co.uk" ];
|
2023-04-29 19:20:42 +01:00
|
|
|
};
|
|
|
|
};
|
2024-04-28 10:39:07 +01:00
|
|
|
}
|
2023-04-29 19:20:42 +01:00
|
|
|
|
2024-04-28 10:39:07 +01:00
|
|
|
(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;
|
2024-04-27 17:06:20 +01:00
|
|
|
})
|
2024-04-28 10:39:07 +01:00
|
|
|
];
|
2023-04-29 19:20:42 +01:00
|
|
|
}
|