lol

nixos/i2pd: tunnel config fixes

Tunnel configuration has no member named "host" - i2pd does but it's called "address" in the options. As a result, no tunnel configuration is generated.

* Fix attribute check in inTunnels
* Fix integer to string coercion in inTunnels
* Add destinationPort option for outTunnels

authored by

John Boehr and committed by
John Boehr
67c3f7f6 ef893323

+12 -5
+12 -5
nixos/modules/services/networking/i2pd.nix
··· 126 [${tun.name}] 127 type = client 128 destination = ${tun.destination} 129 keys = ${tun.keys} 130 address = ${tun.address} 131 port = ${toString tun.port} ··· 137 '') 138 } 139 ${flip concatMapStrings 140 - (collect (tun: tun ? port && tun ? host) cfg.inTunnels) 141 - (tun: let portStr = toString tun.port; in '' 142 [${tun.name}] 143 type = server 144 destination = ${tun.destination} 145 keys = ${tun.keys} 146 host = ${tun.address} 147 - port = ${tun.port} 148 - inport = ${tun.inPort} 149 accesslist = ${builtins.concatStringsSep "," tun.accessList} 150 '') 151 } ··· 405 default = {}; 406 type = with types; loaOf (submodule ( 407 { name, config, ... }: { 408 - options = commonTunOpts name; 409 config = { 410 name = mkDefault name; 411 };
··· 126 [${tun.name}] 127 type = client 128 destination = ${tun.destination} 129 + destinationport = ${toString tun.destinationPort} 130 keys = ${tun.keys} 131 address = ${tun.address} 132 port = ${toString tun.port} ··· 138 '') 139 } 140 ${flip concatMapStrings 141 + (collect (tun: tun ? port && tun ? address) cfg.inTunnels) 142 + (tun: '' 143 [${tun.name}] 144 type = server 145 destination = ${tun.destination} 146 keys = ${tun.keys} 147 host = ${tun.address} 148 + port = ${toString tun.port} 149 + inport = ${toString tun.inPort} 150 accesslist = ${builtins.concatStringsSep "," tun.accessList} 151 '') 152 } ··· 406 default = {}; 407 type = with types; loaOf (submodule ( 408 { name, config, ... }: { 409 + options = { 410 + destinationPort = mkOption { 411 + type = types.int; 412 + default = 0; 413 + description = "Connect to particular port at destination."; 414 + }; 415 + } // commonTunOpts name; 416 config = { 417 name = mkDefault name; 418 };