Skip to content
This repository has been archived by the owner on Apr 12, 2021. It is now read-only.

Commit

Permalink
nixos/i2pd: address #63103
Browse files Browse the repository at this point in the history
As a comment to 1d61efb
Note that collect returns a list from a set
  • Loading branch information
edwtjo committed Feb 19, 2020
1 parent 482642a commit 9bab9e2
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions nixos/modules/services/networking/i2pd.nix
Expand Up @@ -158,10 +158,10 @@ let
(sec "addressbook")
(strOpt "defaulturl" cfg.addressbook.defaulturl)
] ++ (optionalEmptyList "subscriptions" cfg.addressbook.subscriptions)
++ (flip mapAttrs
(collect (name: proto: proto ? port && proto ? address && proto ? name) cfg.proto)
++ (flip map
(collect (proto: proto ? port && proto ? address) cfg.proto)
(proto: let protoOpts = [
(sec name)
(sec proto.name)
(boolOpt "enabled" proto.enable)
(strOpt "address" proto.address)
(intOpt "port" proto.port)
Expand All @@ -181,10 +181,10 @@ let

tunnelConf = let opts = [
notice
(flip mapAttrs
(collect (name: tun: tun ? port && tun ? destination) cfg.outTunnels)
(flip map
(collect (tun: tun ? port && tun ? destination) cfg.outTunnels)
(tun: let outTunOpts = [
(sec name)
(sec tun.name)
"type = client"
(intOpt "port" tun.port)
(strOpt "destination" tun.destination)
Expand All @@ -204,10 +204,10 @@ let
++ (if tun ? crypto.tagsToSend then
optionalNullInt "crypto.tagstosend" tun.crypto.tagsToSend else []);
in concatStringsSep "\n" outTunOpts))
(flip mapAttrs
(collect (name: tun: tun ? port && tun ? address) cfg.inTunnels)
(flip map
(collect (tun: tun ? port && tun ? address) cfg.inTunnels)
(tun: let inTunOpts = [
(sec name)
(sec tun.name)
"type = server"
(intOpt "port" tun.port)
(strOpt "host" tun.address)
Expand Down Expand Up @@ -606,7 +606,7 @@ in

outTunnels = mkOption {
default = {};
type = with types; loaOf (submodule (
type = with types; attrsOf (submodule (
{ name, ... }: {
options = {
destinationPort = mkOption {
Expand All @@ -627,7 +627,7 @@ in

inTunnels = mkOption {
default = {};
type = with types; loaOf (submodule (
type = with types; attrsOf (submodule (
{ name, ... }: {
options = {
inPort = mkOption {
Expand Down

0 comments on commit 9bab9e2

Please sign in to comment.