system: Open dnsmasq ports with hotspot option

Makes it possible to connect to mobile hotspots. Now the PinePhone is
a lot more useful.
This commit is contained in:
Donovan Glover 2024-08-15 10:55:57 -04:00
parent f4193012f9
commit b14eca2c55
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65

View File

@ -14,6 +14,7 @@ let
mkEnableOption mkEnableOption
mkIf mkIf
singleton singleton
optional
; ;
inherit (cfg) inherit (cfg)
@ -23,6 +24,7 @@ let
mullvad mullvad
allowSRB2Port allowSRB2Port
allowDevPort allowDevPort
hotspot
noRoot noRoot
postgres postgres
; ;
@ -79,6 +81,7 @@ in
postgres = mkEnableOption "postgres database for containers"; postgres = mkEnableOption "postgres database for containers";
allowSRB2Port = mkEnableOption "port for srb2"; allowSRB2Port = mkEnableOption "port for srb2";
allowDevPort = mkEnableOption "port for development server"; allowDevPort = mkEnableOption "port for development server";
hotspot = mkEnableOption "mobile hotspot support";
}; };
config = { config = {
@ -246,7 +249,13 @@ in
}; };
firewall = { firewall = {
allowedUDPPorts = mkIf allowSRB2Port [ 5029 ]; allowedUDPPorts =
optional hotspot [
67
68
]
++ optional allowSRB2Port [ 5029 ];
allowedTCPPorts = mkIf allowDevPort [ 3000 ]; allowedTCPPorts = mkIf allowDevPort [ 3000 ];
}; };
}; };