diff options
author | Edward Tjörnhammar <ed@cflags.cc> | 2016-03-13 21:34:21 +0100 |
---|---|---|
committer | Edward Tjörnhammar <ed@cflags.cc> | 2016-03-13 21:36:30 +0100 |
commit | c65026bfa519000519bbb18936b8e902f3bdd9ed (patch) | |
tree | 80648d7642ead87f343b498c3181bf49455a3eeb /nixos/modules/services | |
parent | e433a3015a31aad753ee2165ade88fa568c11172 (diff) | |
download | nixlib-c65026bfa519000519bbb18936b8e902f3bdd9ed.tar nixlib-c65026bfa519000519bbb18936b8e902f3bdd9ed.tar.gz nixlib-c65026bfa519000519bbb18936b8e902f3bdd9ed.tar.bz2 nixlib-c65026bfa519000519bbb18936b8e902f3bdd9ed.tar.lz nixlib-c65026bfa519000519bbb18936b8e902f3bdd9ed.tar.xz nixlib-c65026bfa519000519bbb18936b8e902f3bdd9ed.tar.zst nixlib-c65026bfa519000519bbb18936b8e902f3bdd9ed.zip |
nixos: i2pd, change to yes/no config entries and explicitly enable client endpoints
Diffstat (limited to 'nixos/modules/services')
-rw-r--r-- | nixos/modules/services/networking/i2pd.nix | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/nixos/modules/services/networking/i2pd.nix b/nixos/modules/services/networking/i2pd.nix index e73316a9b1e8..15ec9be80121 100644 --- a/nixos/modules/services/networking/i2pd.nix +++ b/nixos/modules/services/networking/i2pd.nix @@ -10,9 +10,10 @@ let extip = "EXTIP=\$(${pkgs.curl}/bin/curl -sf \"http://jsonip.com\" | ${pkgs.gawk}/bin/awk -F'\"' '{print $4}')"; - toOneZero = b: if b then "1" else "0"; + toYesNo = b: if b then "yes" else "no"; mkEndpointOpt = name: addr: port: { + enable = mkEnableOption name; name = mkOption { type = types.str; default = name; @@ -63,9 +64,9 @@ let } // mkEndpointOpt name "127.0.0.1" 0; i2pdConf = pkgs.writeText "i2pd.conf" '' - ipv6 = ${toOneZero cfg.enableIPv6} - notransit = ${toOneZero cfg.notransit} - floodfill = ${toOneZero cfg.floodfill} + ipv6 = ${toYesNo cfg.enableIPv6} + notransit = ${toYesNo cfg.notransit} + floodfill = ${toYesNo cfg.floodfill} ${if isNull cfg.port then "" else "port = ${toString cfg.port}"} ${flip concatMapStrings (collect (proto: proto ? port && proto ? address && proto ? name) cfg.proto) @@ -73,6 +74,7 @@ let [${proto.name}] address = ${proto.address} port = ${toString proto.port} + enabled = ${toYesNo proto.enable} '') } ''; |