nixos/modules/locations.nix

41 lines
1.4 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 {
default = {
services = {
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";
2023-04-29 19:20:42 +01:00
};
};
};
};
config = lib.mkIf cfg.autoServe {
custom.services.downloads.enable = cfg.locations.services.downloads == config.networking.fqdn;
2023-12-30 22:34:27 +00:00
custom.services.gitea.enable = cfg.locations.services.gitea == config.networking.fqdn;
2023-12-24 22:09:53 +00:00
custom.services.homeassistant.enable = cfg.locations.services.homeassistant == config.networking.fqdn;
2023-01-17 22:36:39 +00:00
custom.services.mastodon.enable = cfg.locations.services.mastodon == config.networking.fqdn;
custom.services.matrix.enable = cfg.locations.services.matrix == config.networking.fqdn;
2024-04-22 20:49:43 +01:00
custom.services.tang.enable = builtins.elem config.networking.fqdn cfg.locations.services.tang;
2023-12-08 21:59:29 +00:00
custom.services.unifi.enable = cfg.locations.services.unifi == config.networking.fqdn;
2023-04-29 19:20:42 +01:00
};
}