nixos/terraria: open ports in the firewall
This commit is contained in:
parent
9b0d67c40e
commit
af0a54285e
@ -111,6 +111,13 @@ in
|
|||||||
default = false;
|
default = false;
|
||||||
description = "Disables automatic Universal Plug and Play.";
|
description = "Disables automatic Universal Plug and Play.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
openFirewall = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Wheter to open ports in the firewall";
|
||||||
|
};
|
||||||
|
|
||||||
dataDir = mkOption {
|
dataDir = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "/var/lib/terraria";
|
default = "/var/lib/terraria";
|
||||||
@ -151,5 +158,11 @@ in
|
|||||||
${pkgs.coreutils}/bin/chgrp terraria ${cfg.dataDir}/terraria.sock
|
${pkgs.coreutils}/bin/chgrp terraria ${cfg.dataDir}/terraria.sock
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
networking.firewall = mkIf cfg.openFirewall {
|
||||||
|
allowedTCPPorts = [ cfg.port ];
|
||||||
|
allowedUDPPorts = [ cfg.port ];
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user