nixos/modules/locations.nix

54 lines
1.3 KiB
Nix
Raw Normal View History

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;
};
};
config = lib.mkMerge [
{
custom.locations.locations = {
2023-04-29 19:20:42 +01:00
services = {
2024-04-27 17:06:20 +01:00
authoritative_dns = [
2024-05-10 22:35:29 +01:00
"boron.cx.ts.hillion.co.uk"
2024-04-27 17:06:20 +01:00
"jorah.cx.ts.hillion.co.uk"
];
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 = "";
2023-11-26 19:44:30 +00:00
matrix = "jorah.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-05-18 16:41:53 +01:00
unifi = "boron.cx.ts.hillion.co.uk";
2024-05-10 22:07:15 +01:00
version_tracker = [ "boron.cx.ts.hillion.co.uk" "jorah.cx.ts.hillion.co.uk" ];
2023-04-29 19:20:42 +01:00
};
};
}
2023-04-29 19:20:42 +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
})
];
2023-04-29 19:20:42 +01:00
}