nixos/modules/locations.nix

53 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 = [
"jorah.cx.ts.hillion.co.uk"
];
downloads = "tywin.storage.ts.hillion.co.uk";
2023-12-30 22:34:27 +00:00
gitea = "jorah.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"
];
2023-12-08 21:59:29 +00:00
unifi = "jorah.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
}