31 lines
653 B
Nix
31 lines
653 B
Nix
{ lib, config, inputs, ... }:
|
|
let
|
|
cfg = config.modules.services.gtrackmap;
|
|
fqdn = "${cfg.subdomain}.${config.networking.domain}";
|
|
in
|
|
{
|
|
imports = [
|
|
inputs.gtrackmap.nixosModules.default
|
|
];
|
|
|
|
options.modules.services.gtrackmap = {
|
|
enable = lib.mkEnableOption "Enable GTrackmap";
|
|
subdomain = lib.mkOption {
|
|
type = lib.types.str;
|
|
};
|
|
port = lib.mkOption {
|
|
type = lib.types.int;
|
|
default = 3200;
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
services.gtrackmap = {
|
|
enable = true;
|
|
inherit (cfg) port;
|
|
};
|
|
|
|
modules.services.webserver.vHosts.${fqdn}.locations."/".proxyPort = cfg.port;
|
|
};
|
|
}
|