Skip to content

Commit db6c599

Browse files
committed
nixos/meme-bingo-web: add address and openFirewall options
1 parent fbc4fb4 commit db6c599

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

nixos/modules/services/web-apps/meme-bingo-web.nix

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ in
3636
default = "http://localhost:41678/";
3737
example = "https://bingo.example.com/";
3838
};
39+
address = mkOption {
40+
description = ''
41+
The address the webserver will bind to.
42+
'';
43+
type = types.str;
44+
default = "localhost";
45+
example = "::";
46+
};
3947
port = mkOption {
4048
description = ''
4149
Port to be used for the web server.
@@ -44,16 +52,22 @@ in
4452
default = 41678;
4553
example = 21035;
4654
};
55+
openFirewall = mkEnableOption ''
56+
Opens the specified port in the firewall.
57+
'';
4758
};
4859
};
4960

5061
config = mkIf cfg.enable {
62+
networking.firewall.allowedTCPPorts = mkIf cfg.openFirewall [ cfg.port ];
63+
5164
systemd.services.meme-bingo-web = {
5265
description = "A web app for playing meme bingos";
5366
wantedBy = [ "multi-user.target" ];
5467

5568
environment = {
5669
MEME_BINGO_BASE = cfg.baseUrl;
70+
MEME_BINGO_ADDRESS = cfg.address;
5771
MEME_BINGO_PORT = toString cfg.port;
5872
};
5973
path = [ cfg.package ];

0 commit comments

Comments
 (0)