diff options
author | Jan Malakhovski <oxij@oxij.org> | 2017-07-02 12:32:17 +0000 |
---|---|---|
committer | Jan Malakhovski <oxij@oxij.org> | 2017-08-25 12:49:10 +0000 |
commit | 27aa99753b3a418cea35156d18a354b794d48f48 (patch) | |
tree | 8d11600242de215014793c2fb2815eb6bcd56c6c /nixos/modules/services/networking/i2pd.nix | |
parent | 3594c4eec656f3443ee03bd1988c77e6b7ebec4b (diff) | |
download | nixlib-27aa99753b3a418cea35156d18a354b794d48f48.tar nixlib-27aa99753b3a418cea35156d18a354b794d48f48.tar.gz nixlib-27aa99753b3a418cea35156d18a354b794d48f48.tar.bz2 nixlib-27aa99753b3a418cea35156d18a354b794d48f48.tar.lz nixlib-27aa99753b3a418cea35156d18a354b794d48f48.tar.xz nixlib-27aa99753b3a418cea35156d18a354b794d48f48.tar.zst nixlib-27aa99753b3a418cea35156d18a354b794d48f48.zip |
nixos: i2pd: fix indent
Diffstat (limited to 'nixos/modules/services/networking/i2pd.nix')
-rw-r--r-- | nixos/modules/services/networking/i2pd.nix | 167 |
1 files changed, 84 insertions, 83 deletions
diff --git a/nixos/modules/services/networking/i2pd.nix b/nixos/modules/services/networking/i2pd.nix index b481f70521b2..5c4932075fed 100644 --- a/nixos/modules/services/networking/i2pd.nix +++ b/nixos/modules/services/networking/i2pd.nix @@ -28,15 +28,15 @@ let }; mkKeyedEndpointOpt = name: addr: port: keyFile: - (mkEndpointOpt name addr port) // { - keys = mkOption { - type = types.str; - default = ""; - description = '' - File to persist ${lib.toUpper name} keys. - ''; + (mkEndpointOpt name addr port) // { + keys = mkOption { + type = types.str; + default = ""; + description = '' + File to persist ${lib.toUpper name} keys. + ''; + }; }; - }; commonTunOpts = let i2cpOpts = { @@ -59,7 +59,7 @@ let description = "Number of ElGamal/AES tags to send."; default = 40; }; - destination = mkOption { + destination = mkOption { type = types.str; description = "Remote endpoint, I2P hostname or b32.i2p address."; }; @@ -70,84 +70,85 @@ let }; } // mkEndpointOpt name "127.0.0.1" 0; - i2pdConf = pkgs.writeText "i2pd.conf" - '' - loglevel = ${cfg.logLevel} - - ipv4 = ${boolToString cfg.enableIPv4} - ipv6 = ${boolToString cfg.enableIPv6} - notransit = ${boolToString cfg.notransit} - floodfill = ${boolToString cfg.floodfill} - netid = ${toString cfg.netid} - ${if isNull cfg.bandwidth then "" else "bandwidth = ${toString cfg.bandwidth}" } - ${if isNull cfg.port then "" else "port = ${toString cfg.port}"} - - [limits] - transittunnels = ${toString cfg.limits.transittunnels} - - [upnp] - enabled = ${boolToString cfg.upnp.enable} - name = ${cfg.upnp.name} - - [precomputation] - elgamal = ${boolToString cfg.precomputation.elgamal} - - [reseed] - verify = ${boolToString cfg.reseed.verify} - file = ${cfg.reseed.file} - urls = ${builtins.concatStringsSep "," cfg.reseed.urls} - - [addressbook] - defaulturl = ${cfg.addressbook.defaulturl} - subscriptions = ${builtins.concatStringsSep "," cfg.addressbook.subscriptions} - ${flip concatMapStrings + i2pdConf = pkgs.writeText "i2pd.conf" '' + # DO NOT EDIT -- this file has been generated automatically. + loglevel = ${cfg.logLevel} + + ipv4 = ${boolToString cfg.enableIPv4} + ipv6 = ${boolToString cfg.enableIPv6} + notransit = ${boolToString cfg.notransit} + floodfill = ${boolToString cfg.floodfill} + netid = ${toString cfg.netid} + ${if isNull cfg.bandwidth then "" else "bandwidth = ${toString cfg.bandwidth}" } + ${if isNull cfg.port then "" else "port = ${toString cfg.port}"} + + [limits] + transittunnels = ${toString cfg.limits.transittunnels} + + [upnp] + enabled = ${boolToString cfg.upnp.enable} + name = ${cfg.upnp.name} + + [precomputation] + elgamal = ${boolToString cfg.precomputation.elgamal} + + [reseed] + verify = ${boolToString cfg.reseed.verify} + file = ${cfg.reseed.file} + urls = ${builtins.concatStringsSep "," cfg.reseed.urls} + + [addressbook] + defaulturl = ${cfg.addressbook.defaulturl} + subscriptions = ${builtins.concatStringsSep "," cfg.addressbook.subscriptions} + + ${flip concatMapStrings (collect (proto: proto ? port && proto ? address && proto ? name) cfg.proto) - (proto: let portStr = toString proto.port; in - '' - [${proto.name}] - enabled = ${boolToString proto.enable} - address = ${proto.address} - port = ${toString proto.port} - ${if proto ? keys then "keys = ${proto.keys}" else ""} - ${if proto ? auth then "auth = ${boolToString proto.auth}" else ""} - ${if proto ? user then "user = ${proto.user}" else ""} - ${if proto ? pass then "pass = ${proto.pass}" else ""} - ${if proto ? outproxy then "outproxy = ${proto.outproxy}" else ""} - ${if proto ? outproxyPort then "outproxyport = ${toString proto.outproxyPort}" else ""} - '') - } + (proto: let portStr = toString proto.port; in '' + [${proto.name}] + enabled = ${boolToString proto.enable} + address = ${proto.address} + port = ${toString proto.port} + ${if proto ? keys then "keys = ${proto.keys}" else ""} + ${if proto ? auth then "auth = ${boolToString proto.auth}" else ""} + ${if proto ? user then "user = ${proto.user}" else ""} + ${if proto ? pass then "pass = ${proto.pass}" else ""} + ${if proto ? outproxy then "outproxy = ${proto.outproxy}" else ""} + ${if proto ? outproxyPort then "outproxyport = ${toString proto.outproxyPort}" else ""} + '') + } ''; i2pdTunnelConf = pkgs.writeText "i2pd-tunnels.conf" '' - ${flip concatMapStrings - (collect (tun: tun ? port && tun ? destination) cfg.outTunnels) - (tun: let portStr = toString tun.port; in '' - [${tun.name}] - type = client - destination = ${tun.destination} - keys = ${tun.keys} - address = ${tun.address} - port = ${toString tun.port} - inbound.length = ${toString tun.inbound.length} - outbound.length = ${toString tun.outbound.length} - inbound.quantity = ${toString tun.inbound.quantity} - outbound.quantity = ${toString tun.outbound.quantity} - crypto.tagsToSend = ${toString tun.crypto.tagsToSend} - '') - } - ${flip concatMapStrings - (collect (tun: tun ? port && tun ? host) cfg.inTunnels) - (tun: let portStr = toString tun.port; in '' - [${tun.name}] - type = server - destination = ${tun.destination} - keys = ${tun.keys} - host = ${tun.address} - port = ${tun.port} - inport = ${tun.inPort} - accesslist = ${builtins.concatStringsSep "," tun.accessList} - '') - } + # DO NOT EDIT -- this file has been generated automatically. + ${flip concatMapStrings + (collect (tun: tun ? port && tun ? destination) cfg.outTunnels) + (tun: let portStr = toString tun.port; in '' + [${tun.name}] + type = client + destination = ${tun.destination} + keys = ${tun.keys} + address = ${tun.address} + port = ${toString tun.port} + inbound.length = ${toString tun.inbound.length} + outbound.length = ${toString tun.outbound.length} + inbound.quantity = ${toString tun.inbound.quantity} + outbound.quantity = ${toString tun.outbound.quantity} + crypto.tagsToSend = ${toString tun.crypto.tagsToSend} + '') + } + ${flip concatMapStrings + (collect (tun: tun ? port && tun ? host) cfg.inTunnels) + (tun: let portStr = toString tun.port; in '' + [${tun.name}] + type = server + destination = ${tun.destination} + keys = ${tun.keys} + host = ${tun.address} + port = ${tun.port} + inport = ${tun.inPort} + accesslist = ${builtins.concatStringsSep "," tun.accessList} + '') + } ''; i2pdSh = pkgs.writeScriptBin "i2pd" '' |