add options.services.wa2k

This commit is contained in:
do butterflies cry? 2026-03-14 16:25:55 +10:00
parent 4d8b686094
commit 6be517516c
Signed by: cry
GPG key ID: F68745A836CA0412

View file

@ -4,10 +4,33 @@
lib, lib,
... ...
}: let }: let
inherit (lib) mkEnableOption mkOption types;
cfg = config.services.wa2k; cfg = config.services.wa2k;
in { in {
imports = [./wa2k]; options.services.wa2k = {
enable = mkEnableOption "webserver for wa2k.com";
port = mkOption {
types = types.port;
default = 80;
example = 8080;
description = ''
The listening port on localhost to bind the wa2k.com server to.
'';
};
openFirewall = mkOption {
types = types.bool;
default = false;
example = true;
description = ''
Whether the wa2k listening port should be automatically opened in the system's firewall.
'';
};
};
config = lib.mkIf cfg.enable {
networking.firewall.allowedTCPPorts = lib.optional cfg.openFirewall [cfg.port]; networking.firewall.allowedTCPPorts = lib.optional cfg.openFirewall [cfg.port];
# REF: https://nixos.wiki/wiki/Static_Web_Server # REF: https://nixos.wiki/wiki/Static_Web_Server
@ -22,4 +45,5 @@ in {
}; };
}; };
}; };
};
} }