diff options
author | lassulus <lass@aidsballs.de> | 2016-02-06 18:45:38 +0100 |
---|---|---|
committer | lassulus <lass@aidsballs.de> | 2016-02-06 18:45:38 +0100 |
commit | fe586d704eed42421ad3fe0d140c0caa64764a68 (patch) | |
tree | a07d0c4d09ef780f703ae03435d51ac60019c956 /krebs/4lib | |
parent | 138bdc6bf6a18a59cf47d2d2db7c4e7640f50641 (diff) | |
parent | c784d271c5dc8783e5e6308baf4f6dd26430bfca (diff) |
Merge remote-tracking branch 'cd/master'
Diffstat (limited to 'krebs/4lib')
-rw-r--r-- | krebs/4lib/default.nix | 1 | ||||
-rw-r--r-- | krebs/4lib/types.nix | 16 |
2 files changed, 10 insertions, 7 deletions
diff --git a/krebs/4lib/default.nix b/krebs/4lib/default.nix index dfc51bbe4..4d7e0b549 100644 --- a/krebs/4lib/default.nix +++ b/krebs/4lib/default.nix @@ -6,6 +6,7 @@ with lib; let out = rec { eq = x: y: x == y; + ne = x: y: x != y; mod = x: y: x - y * (x / y); diff --git a/krebs/4lib/types.nix b/krebs/4lib/types.nix index c596d0f9d..6c396a132 100644 --- a/krebs/4lib/types.nix +++ b/krebs/4lib/types.nix @@ -119,16 +119,18 @@ types // rec { default = {}; }; tinc = mkOption { - type = let net-config = config; in nullOr (submodule ({ config, ... }: { + type = let net = config; in nullOr (submodule ({ config, ... }: { options = { config = mkOption { type = str; - default = '' - ${optionalString (net-config.via != null) - (concatMapStringsSep "\n" (a: "Address = ${a}") net-config.via.addrs)} - ${concatMapStringsSep "\n" (a: "Subnet = ${a}") net-config.addrs} - ${config.pubkey} - ''; + default = concatStringsSep "\n" ( + (optionals (net.via != null) + (map (a: "Address = ${a}") net.via.addrs)) + ++ + (map (a: "Subnet = ${a}") net.addrs) + ++ + [config.pubkey] + ); }; pubkey = mkOption { type = str; |