retiolum: add port option

This commit is contained in:
Ingolf Wagner 2023-01-31 14:48:51 +01:00 committed by Jörg Thalheim
parent feaf28b655
commit df5911a99e

View File

@ -32,6 +32,13 @@ in {
tinc network name tinc network name
''; '';
}; };
networking.retiolum.port = mkOption {
type = types.int;
default = 655;
description = ''
port tinc is listen
'';
};
}; };
config = { config = {
@ -40,6 +47,7 @@ in {
# allow resolving dns # allow resolving dns
chroot = false; chroot = false;
extraConfig = '' extraConfig = ''
Port = ${toString cfg.port}
LocalDiscovery = yes LocalDiscovery = yes
ConnectTo = eva ConnectTo = eva
@ -90,8 +98,8 @@ in {
serviceConfig.ExecReload = "${config.services.tinc.networks.${netname}.package}/bin/tinc -n ${netname} reload"; serviceConfig.ExecReload = "${config.services.tinc.networks.${netname}.package}/bin/tinc -n ${netname} reload";
}; };
networking.firewall.allowedTCPPorts = [ 655 ]; networking.firewall.allowedTCPPorts = [ cfg.port ];
networking.firewall.allowedUDPPorts = [ 655 ]; networking.firewall.allowedUDPPorts = [ cfg.port ];
warnings = lib.optional (cfg.ipv6 == null) '' warnings = lib.optional (cfg.ipv6 == null) ''
`networking.retiolum.ipv6` is not set `networking.retiolum.ipv6` is not set