File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
nixos/modules/services/web-apps Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 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.
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 ] ;
You can’t perform that action at this time.
0 commit comments