fix my oopid mistakes

This commit is contained in:
do butterflies cry? 2026-03-14 16:49:15 +10:00
parent 6be517516c
commit 49f2a8b48d
Signed by: cry
GPG key ID: F68745A836CA0412

View file

@ -12,8 +12,8 @@ in {
enable = mkEnableOption "webserver for wa2k.com"; enable = mkEnableOption "webserver for wa2k.com";
port = mkOption { port = mkOption {
types = types.port; type = types.port;
default = 80; default = 8080;
example = 8080; example = 8080;
description = '' description = ''
The listening port on localhost to bind the wa2k.com server to. The listening port on localhost to bind the wa2k.com server to.
@ -21,7 +21,7 @@ in {
}; };
openFirewall = mkOption { openFirewall = mkOption {
types = types.bool; type = types.bool;
default = false; default = false;
example = true; example = true;
description = '' description = ''
@ -30,13 +30,13 @@ in {
}; };
}; };
config = lib.mkIf cfg.enable { config = {
networking.firewall.allowedTCPPorts = lib.optional cfg.openFirewall [cfg.port]; networking.firewall.allowedTCPPorts = lib.optional (cfg.enable && cfg.openFirewall) cfg.port;
# REF: https://nixos.wiki/wiki/Static_Web_Server # REF: https://nixos.wiki/wiki/Static_Web_Server
services.static-web-server = { services.static-web-server = {
enable = true; enable = cfg.enable;
listen = "[::]:${cfg.port}"; listen = "[::]:${builtins.toString cfg.port}";
root = "${pkgs.wa2k-website}/www"; root = "${pkgs.wa2k-website}/www";
configuration = { configuration = {