matrix: support via a locations api
This commit is contained in:
parent
91d132a9a0
commit
3058e4eb50
@ -20,6 +20,7 @@
|
||||
|
||||
## Custom Services
|
||||
custom = {
|
||||
locations.autoServe = true;
|
||||
www.global.enable = true;
|
||||
services.matrix.enable = true;
|
||||
};
|
||||
|
@ -4,6 +4,7 @@
|
||||
imports = [
|
||||
./backups/default.nix
|
||||
./desktop/awesome/default.nix
|
||||
./locations.nix
|
||||
./resilio.nix
|
||||
./services/matrix.nix
|
||||
./tailscale.nix
|
||||
|
25
modules/locations.nix
Normal file
25
modules/locations.nix
Normal file
@ -0,0 +1,25 @@
|
||||
{ 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";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.autoServe {
|
||||
custom.services.matrix.enable = cfg.locations.services.matrix == config.networking.fqdn;
|
||||
};
|
||||
}
|
@ -2,6 +2,7 @@
|
||||
|
||||
let
|
||||
cfg = config.custom.www.global;
|
||||
locations = config.custom.locations.locations;
|
||||
in
|
||||
{
|
||||
options.custom.www.global = {
|
||||
@ -39,7 +40,7 @@ in
|
||||
reverse_proxy http://plex.mediaserver.ts.hillion.co.uk:8096
|
||||
'';
|
||||
virtualHosts."matrix.hillion.co.uk".extraConfig = ''
|
||||
reverse_proxy http://vm.strangervm.ts.hillion.co.uk:8008
|
||||
reverse_proxy http://${locations.services.matrix}:8008
|
||||
'';
|
||||
virtualHosts."unifi.hillion.co.uk".extraConfig = ''
|
||||
reverse_proxy https://unifi.unifi.ts.hillion.co.uk:8443 {
|
||||
|
Loading…
Reference in New Issue
Block a user