git.iko.soy/typeable/nixpkgs
on master help sign in
nixos: i2pd: fix indent
commit27aa99753b3a418cea35156d18a354b794d48f48 authorJan Malakhovski <oxij@oxij.org> dateSun 2 Jul 2017, 12:32 (9 years ago) parent3594c4e
1 file changed+84−83
nixos/modules/services/networking/i2pd.nix+84−83
nixos/modules/services/networking/i2pd.nix+84−83
@@ -28,15 +28,15 @@ let
2828 };
2929
3030 mkKeyedEndpointOpt = name: addr: port: keyFile:
31− (mkEndpointOpt name addr port) // {
32− keys = mkOption {
33− type = types.str;
34− default = "";
35− description = ''
36− File to persist ${lib.toUpper name} keys.
37− '';
31+ (mkEndpointOpt name addr port) // {
32+ keys = mkOption {
33+ type = types.str;
34+ default = "";
35+ description = ''
36+ File to persist ${lib.toUpper name} keys.
37+ '';
38+ };
3839 };
39− };
4040
4141 commonTunOpts = let
4242 i2cpOpts = {
@@ -59,7 +59,7 @@ let
5959 description = "Number of ElGamal/AES tags to send.";
6060 default = 40;
6161 };
62− destination = mkOption {
62+ destination = mkOption {
6363 type = types.str;
6464 description = "Remote endpoint, I2P hostname or b32.i2p address.";
6565 };
@@ -70,84 +70,85 @@ let
7070 };
7171 } // mkEndpointOpt name "127.0.0.1" 0;
7272
73− i2pdConf = pkgs.writeText "i2pd.conf"
74− ''
75− loglevel = ${cfg.logLevel}
76−
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}"}
84−
85− [limits]
86− transittunnels = ${toString cfg.limits.transittunnels}
87−
88− [upnp]
89− enabled = ${boolToString cfg.upnp.enable}
90− name = ${cfg.upnp.name}
91−
92− [precomputation]
93− elgamal = ${boolToString cfg.precomputation.elgamal}
94−
95− [reseed]
96− verify = ${boolToString cfg.reseed.verify}
97− file = ${cfg.reseed.file}
98− urls = ${builtins.concatStringsSep "," cfg.reseed.urls}
99−
100− [addressbook]
101− defaulturl = ${cfg.addressbook.defaulturl}
102− subscriptions = ${builtins.concatStringsSep "," cfg.addressbook.subscriptions}
103− ${flip concatMapStrings
73+ i2pdConf = pkgs.writeText "i2pd.conf" ''
74+ # DO NOT EDIT -- this file has been generated automatically.
75+ loglevel = ${cfg.logLevel}
76+
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}"}
84+
85+ [limits]
86+ transittunnels = ${toString cfg.limits.transittunnels}
87+
88+ [upnp]
89+ enabled = ${boolToString cfg.upnp.enable}
90+ name = ${cfg.upnp.name}
91+
92+ [precomputation]
93+ elgamal = ${boolToString cfg.precomputation.elgamal}
94+
95+ [reseed]
96+ verify = ${boolToString cfg.reseed.verify}
97+ file = ${cfg.reseed.file}
98+ urls = ${builtins.concatStringsSep "," cfg.reseed.urls}
99+
100+ [addressbook]
101+ defaulturl = ${cfg.addressbook.defaulturl}
102+ subscriptions = ${builtins.concatStringsSep "," cfg.addressbook.subscriptions}
103+
104+ ${flip concatMapStrings
104105 (collect (proto: proto ? port && proto ? address && proto ? name) cfg.proto)
105− (proto: let portStr = toString proto.port; in
106− ''
107− [${proto.name}]
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 ""}
117− '')
118− }
106+ (proto: let portStr = toString proto.port; in ''
107+ [${proto.name}]
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 ""}
117+ '')
118+ }
119119 '';
120120
121121 i2pdTunnelConf = pkgs.writeText "i2pd-tunnels.conf" ''
122− ${flip concatMapStrings
123− (collect (tun: tun ? port && tun ? destination) cfg.outTunnels)
124− (tun: let portStr = toString tun.port; in ''
125− [${tun.name}]
126− type = client
127− destination = ${tun.destination}
128− keys = ${tun.keys}
129− address = ${tun.address}
130− port = ${toString tun.port}
131− inbound.length = ${toString tun.inbound.length}
132− outbound.length = ${toString tun.outbound.length}
133− inbound.quantity = ${toString tun.inbound.quantity}
134− outbound.quantity = ${toString tun.outbound.quantity}
135− crypto.tagsToSend = ${toString tun.crypto.tagsToSend}
136− '')
137− }
138− ${flip concatMapStrings
139− (collect (tun: tun ? port && tun ? host) cfg.inTunnels)
140− (tun: let portStr = toString tun.port; in ''
141− [${tun.name}]
142− type = server
143− destination = ${tun.destination}
144− keys = ${tun.keys}
145− host = ${tun.address}
146− port = ${tun.port}
147− inport = ${tun.inPort}
148− accesslist = ${builtins.concatStringsSep "," tun.accessList}
149− '')
150− }
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 ''
126+ [${tun.name}]
127+ type = client
128+ destination = ${tun.destination}
129+ keys = ${tun.keys}
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}
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+ }
151152 '';
152153
153154 i2pdSh = pkgs.writeScriptBin "i2pd" ''