nixos/modules/locations.nix
Jake Hillion 01675c85cb
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
mastodon: initial setup
2023-04-29 23:34:44 +01:00

28 lines
631 B
Nix

{ 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";
mastodon = "vm.strangervm.ts.hillion.co.uk";
};
};
};
};
config = lib.mkIf cfg.autoServe {
custom.services.matrix.enable = cfg.locations.services.matrix == config.networking.fqdn;
custom.services.mastodon.enable = cfg.locations.services.mastodon == config.networking.fqdn;
};
}