diff options
author | tv <tv@krebsco.de> | 2016-02-06 15:11:30 +0100 |
---|---|---|
committer | tv <tv@krebsco.de> | 2016-02-06 15:11:30 +0100 |
commit | 23c7c10f5a5ed83dca001d7382e5b89981277f8c (patch) | |
tree | 274a199ba7748892a7dfd4cd5f31b0f83985b206 /krebs/4lib | |
parent | b2303e081fb1ccc9a0b88f538736045fb2fba14f (diff) |
krebs.retiolum.hosts: change type to attrsOf host
Diffstat (limited to 'krebs/4lib')
-rw-r--r-- | krebs/4lib/types.nix | 16 |
1 files changed, 9 insertions, 7 deletions
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; |