diff options
author | Geoffrey Huntley <ghuntley@ghuntley.com> | 2018-06-24 11:07:30 +1000 |
---|---|---|
committer | Geoffrey Huntley <ghuntley@ghuntley.com> | 2018-08-09 00:00:12 +1000 |
commit | 5b66ddb94333fe6f67bd33e0150045e547416ac7 (patch) | |
tree | 473a530b81da5c7968a1293ccb79b1d16b10c497 /nixos | |
parent | 9c1edbddeefaa73513da566f02a0913f36d5bf22 (diff) | |
download | nixlib-5b66ddb94333fe6f67bd33e0150045e547416ac7.tar nixlib-5b66ddb94333fe6f67bd33e0150045e547416ac7.tar.gz nixlib-5b66ddb94333fe6f67bd33e0150045e547416ac7.tar.bz2 nixlib-5b66ddb94333fe6f67bd33e0150045e547416ac7.tar.lz nixlib-5b66ddb94333fe6f67bd33e0150045e547416ac7.tar.xz nixlib-5b66ddb94333fe6f67bd33e0150045e547416ac7.tar.zst nixlib-5b66ddb94333fe6f67bd33e0150045e547416ac7.zip |
nixos/zerotier: added option to customise the port used
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/networking/zerotierone.nix | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/nixos/modules/services/networking/zerotierone.nix b/nixos/modules/services/networking/zerotierone.nix index cd1617b8e2ba..833c8ec32813 100644 --- a/nixos/modules/services/networking/zerotierone.nix +++ b/nixos/modules/services/networking/zerotierone.nix @@ -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 = [ "zt0" ]; - # 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 ]; }; |