···
mkKeyedEndpointOpt = name: addr: port: keyFile:
31
-
(mkEndpointOpt name addr port) // {
36
-
File to persist ${lib.toUpper name} keys.
31
+
(mkEndpointOpt name addr port) // {
36
+
File to persist ${lib.toUpper name} keys.
···
description = "Number of ElGamal/AES tags to send.";
62
-
destination = mkOption {
62
+
destination = mkOption {
description = "Remote endpoint, I2P hostname or b32.i2p address.";
···
} // mkEndpointOpt name "127.0.0.1" 0;
73
-
i2pdConf = pkgs.writeText "i2pd.conf"
75
-
ipv4 = ${boolToString cfg.enableIPv4}
76
-
ipv6 = ${boolToString cfg.enableIPv6}
77
-
notransit = ${boolToString cfg.notransit}
78
-
floodfill = ${boolToString cfg.floodfill}
79
-
netid = ${toString cfg.netid}
80
-
${if isNull cfg.bandwidth then "" else "bandwidth = ${toString cfg.bandwidth}" }
81
-
${if isNull cfg.port then "" else "port = ${toString cfg.port}"}
73
+
i2pdConf = pkgs.writeText "i2pd.conf" ''
74
+
# DO NOT EDIT -- this file has been generated automatically.
75
+
loglevel = ${cfg.logLevel}
84
-
transittunnels = ${toString cfg.limits.transittunnels}
77
+
ipv4 = ${boolToString cfg.enableIPv4}
78
+
ipv6 = ${boolToString cfg.enableIPv6}
79
+
notransit = ${boolToString cfg.notransit}
80
+
floodfill = ${boolToString cfg.floodfill}
81
+
netid = ${toString cfg.netid}
82
+
${if isNull cfg.bandwidth then "" else "bandwidth = ${toString cfg.bandwidth}" }
83
+
${if isNull cfg.port then "" else "port = ${toString cfg.port}"}
87
-
enabled = ${boolToString cfg.upnp.enable}
88
-
name = ${cfg.upnp.name}
86
+
transittunnels = ${toString cfg.limits.transittunnels}
91
-
elgamal = ${boolToString cfg.precomputation.elgamal}
89
+
enabled = ${boolToString cfg.upnp.enable}
90
+
name = ${cfg.upnp.name}
94
-
verify = ${boolToString cfg.reseed.verify}
95
-
file = ${cfg.reseed.file}
96
-
urls = ${builtins.concatStringsSep "," cfg.reseed.urls}
93
+
elgamal = ${boolToString cfg.precomputation.elgamal}
99
-
defaulturl = ${cfg.addressbook.defaulturl}
100
-
subscriptions = ${builtins.concatStringsSep "," cfg.addressbook.subscriptions}
101
-
${flip concatMapStrings
96
+
verify = ${boolToString cfg.reseed.verify}
97
+
file = ${cfg.reseed.file}
98
+
urls = ${builtins.concatStringsSep "," cfg.reseed.urls}
101
+
defaulturl = ${cfg.addressbook.defaulturl}
102
+
subscriptions = ${builtins.concatStringsSep "," cfg.addressbook.subscriptions}
104
+
${flip concatMapStrings
(collect (proto: proto ? port && proto ? address && proto ? name) cfg.proto)
103
-
(proto: let portStr = toString proto.port; in
106
-
enabled = ${boolToString proto.enable}
107
-
address = ${proto.address}
108
-
port = ${toString proto.port}
109
-
${if proto ? keys then "keys = ${proto.keys}" else ""}
110
-
${if proto ? auth then "auth = ${boolToString proto.auth}" else ""}
111
-
${if proto ? user then "user = ${proto.user}" else ""}
112
-
${if proto ? pass then "pass = ${proto.pass}" else ""}
113
-
${if proto ? outproxy then "outproxy = ${proto.outproxy}" else ""}
114
-
${if proto ? outproxyPort then "outproxyport = ${toString proto.outproxyPort}" else ""}
106
+
(proto: let portStr = toString proto.port; in ''
108
+
enabled = ${boolToString proto.enable}
109
+
address = ${proto.address}
110
+
port = ${toString proto.port}
111
+
${if proto ? keys then "keys = ${proto.keys}" else ""}
112
+
${if proto ? auth then "auth = ${boolToString proto.auth}" else ""}
113
+
${if proto ? user then "user = ${proto.user}" else ""}
114
+
${if proto ? pass then "pass = ${proto.pass}" else ""}
115
+
${if proto ? outproxy then "outproxy = ${proto.outproxy}" else ""}
116
+
${if proto ? outproxyPort then "outproxyport = ${toString proto.outproxyPort}" else ""}
i2pdTunnelConf = pkgs.writeText "i2pd-tunnels.conf" ''
120
-
${flip concatMapStrings
121
-
(collect (tun: tun ? port && tun ? destination) cfg.outTunnels)
122
-
(tun: let portStr = toString tun.port; in ''
125
-
destination = ${tun.destination}
127
-
address = ${tun.address}
128
-
port = ${toString tun.port}
129
-
inbound.length = ${toString tun.inbound.length}
130
-
outbound.length = ${toString tun.outbound.length}
131
-
inbound.quantity = ${toString tun.inbound.quantity}
132
-
outbound.quantity = ${toString tun.outbound.quantity}
133
-
crypto.tagsToSend = ${toString tun.crypto.tagsToSend}
136
-
${flip concatMapStrings
137
-
(collect (tun: tun ? port && tun ? host) cfg.inTunnels)
138
-
(tun: let portStr = toString tun.port; in ''
141
-
destination = ${tun.destination}
143
-
host = ${tun.address}
145
-
inport = ${tun.inPort}
146
-
accesslist = ${builtins.concatStringsSep "," tun.accessList}
122
+
# DO NOT EDIT -- this file has been generated automatically.
123
+
${flip concatMapStrings
124
+
(collect (tun: tun ? port && tun ? destination) cfg.outTunnels)
125
+
(tun: let portStr = toString tun.port; in ''
128
+
destination = ${tun.destination}
130
+
address = ${tun.address}
131
+
port = ${toString tun.port}
132
+
inbound.length = ${toString tun.inbound.length}
133
+
outbound.length = ${toString tun.outbound.length}
134
+
inbound.quantity = ${toString tun.inbound.quantity}
135
+
outbound.quantity = ${toString tun.outbound.quantity}
136
+
crypto.tagsToSend = ${toString tun.crypto.tagsToSend}
139
+
${flip concatMapStrings
140
+
(collect (tun: tun ? port && tun ? host) cfg.inTunnels)
141
+
(tun: let portStr = toString tun.port; in ''
144
+
destination = ${tun.destination}
146
+
host = ${tun.address}
148
+
inport = ${tun.inPort}
149
+
accesslist = ${builtins.concatStringsSep "," tun.accessList}
i2pdSh = pkgs.writeScriptBin "i2pd" ''
153
-
${pkgs.i2pd}/bin/i2pd \
154
-
${if isNull cfg.extIp then "" else "--host="+cfg.extIp} \
156
+
exec ${pkgs.i2pd}/bin/i2pd \
157
+
${if isNull cfg.address then "" else "--host="+cfg.address} \
--tunconf=${i2pdTunnelConf}
···
182
+
logLevel = mkOption {
183
+
type = types.enum ["debug" "info" "warn" "error"];
186
+
The log level. <command>i2pd</command> defaults to "info"
187
+
but that generates copious amounts of log messages.
189
+
We default to "error" which is similar to the default log
190
+
level of <command>tor</command>.
194
+
address = mkOption {
type = with types; nullOr str;
198
+
Your external IP or hostname.
···
Set a router bandwidth limit integer in KBps.
216
-
If not set, i2pd defaults to 32KBps.
231
+
If not set, <command>i2pd</command> defaults to 32KBps.
···
precomputation.elgamal = mkOption {
266
-
Use ElGamal precomputated tables.
281
+
Whenever to use precomputated tables for ElGamal.
282
+
<command>i2pd</command> defaults to <literal>false</literal>
283
+
to save 64M of memory (and looses some performance).
285
+
We default to <literal>true</literal> as that is what most
···
356
-
proto.httpProxy = mkKeyedEndpointOpt "httpproxy" "127.0.0.1" 4446 "";
376
+
proto.httpProxy = mkKeyedEndpointOpt "httpproxy" "127.0.0.1" 4444 "";
proto.socksProxy = (mkKeyedEndpointOpt "socksproxy" "127.0.0.1" 4447 "")