mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 15:11:25 +00:00
Merge pull request #42469 from ghuntley/patch-4
zerotier: added option to customise the port used
This commit is contained in:
commit
565479374b
@ -17,6 +17,15 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
options.services.zerotierone.port = mkOption {
|
||||
default = 9993;
|
||||
example = 9993;
|
||||
type = types.int;
|
||||
description = ''
|
||||
Network port used by ZeroTier.
|
||||
'';
|
||||
};
|
||||
|
||||
options.services.zerotierone.package = mkOption {
|
||||
default = pkgs.zerotierone;
|
||||
defaultText = "pkgs.zerotierone";
|
||||
@ -40,7 +49,7 @@ in
|
||||
touch "/var/lib/zerotier-one/networks.d/${netId}.conf"
|
||||
'') cfg.joinNetworks);
|
||||
serviceConfig = {
|
||||
ExecStart = "${cfg.package}/bin/zerotier-one";
|
||||
ExecStart = "${cfg.package}/bin/zerotier-one -p${toString cfg.port}";
|
||||
Restart = "always";
|
||||
KillMode = "process";
|
||||
};
|
||||
@ -49,8 +58,8 @@ in
|
||||
# ZeroTier does not issue DHCP leases, but some strangers might...
|
||||
networking.dhcpcd.denyInterfaces = [ "zt*" ];
|
||||
|
||||
# ZeroTier receives UDP transmissions on port 9993 by default
|
||||
networking.firewall.allowedUDPPorts = [ 9993 ];
|
||||
# ZeroTier receives UDP transmissions
|
||||
networking.firewall.allowedUDPPorts = [ cfg.port ];
|
||||
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user