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 = {
|
|
|
|
matrix = "vm.strangervm.ts.hillion.co.uk";
|
2023-01-17 22:36:39 +00:00
|
|
|
mastodon = "vm.strangervm.ts.hillion.co.uk";
|
2023-04-29 19:20:42 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.autoServe {
|
|
|
|
custom.services.matrix.enable = cfg.locations.services.matrix == config.networking.fqdn;
|
2023-01-17 22:36:39 +00:00
|
|
|
custom.services.mastodon.enable = cfg.locations.services.mastodon == config.networking.fqdn;
|
2023-04-29 19:20:42 +01:00
|
|
|
};
|
|
|
|
}
|