refactor
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{ lib, config, inputs, ... }:
|
||||
let
|
||||
cfg = config.modules.services.gtrackmap;
|
||||
cfg = config.services.gtrackmap;
|
||||
fqdn = "${cfg.subdomain}.${config.networking.domain}";
|
||||
in
|
||||
{
|
||||
@@ -8,23 +8,13 @@ in
|
||||
inputs.gtrackmap.nixosModules.default
|
||||
];
|
||||
|
||||
options.modules.services.gtrackmap = {
|
||||
enable = lib.mkEnableOption "Enable GTrackmap";
|
||||
options.services.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;
|
||||
services.webserver.vHosts.${fqdn}.locations."/".proxyPort = cfg.port;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user