diff options
Diffstat (limited to 'nixos/modules/services/networking/i2pd.nix')
-rw-r--r-- | nixos/modules/services/networking/i2pd.nix | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/nixos/modules/services/networking/i2pd.nix b/nixos/modules/services/networking/i2pd.nix index c5b27350b3c..24a3196bed4 100644 --- a/nixos/modules/services/networking/i2pd.nix +++ b/nixos/modules/services/networking/i2pd.nix @@ -10,8 +10,6 @@ let extip = "EXTIP=\$(${pkgs.curl.bin}/bin/curl -sLf \"http://jsonip.com\" | ${pkgs.gawk}/bin/awk -F'\"' '{print $4}')"; - toYesNo = b: if b then "true" else "false"; - mkEndpointOpt = name: addr: port: { enable = mkEnableOption name; name = mkOption { @@ -76,10 +74,10 @@ let i2pdConf = pkgs.writeText "i2pd.conf" '' - ipv4 = ${toYesNo cfg.enableIPv4} - ipv6 = ${toYesNo cfg.enableIPv6} - notransit = ${toYesNo cfg.notransit} - floodfill = ${toYesNo cfg.floodfill} + 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}"} @@ -88,14 +86,14 @@ let transittunnels = ${toString cfg.limits.transittunnels} [upnp] - enabled = ${toYesNo cfg.upnp.enable} + enabled = ${boolToString cfg.upnp.enable} name = ${cfg.upnp.name} [precomputation] - elgamal = ${toYesNo cfg.precomputation.elgamal} + elgamal = ${boolToString cfg.precomputation.elgamal} [reseed] - verify = ${toYesNo cfg.reseed.verify} + verify = ${boolToString cfg.reseed.verify} file = ${cfg.reseed.file} urls = ${builtins.concatStringsSep "," cfg.reseed.urls} @@ -107,11 +105,11 @@ let (proto: let portStr = toString proto.port; in '' [${proto.name}] - enabled = ${toYesNo proto.enable} + enabled = ${boolToString proto.enable} address = ${proto.address} port = ${toString proto.port} ${if proto ? keys then "keys = ${proto.keys}" else ""} - ${if proto ? auth then "auth = ${toYesNo proto.auth}" 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 ""} |