From 236a7c54524b89adcf6334d6f87689cfc162fdbc Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Fri, 10 Nov 2017 11:35:32 +0100 Subject: [PATCH 1/3] babeld module: separate default options by space In the previous version multiple default values would generate an invalid babeld config file since all options would be concatenated without any separator. --- nixos/modules/services/networking/babeld.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/networking/babeld.nix b/nixos/modules/services/networking/babeld.nix index dd76bac9df7..296de058cd9 100644 --- a/nixos/modules/services/networking/babeld.nix +++ b/nixos/modules/services/networking/babeld.nix @@ -7,7 +7,7 @@ let cfg = config.services.babeld; paramsString = params: - concatMapStringsSep "" (name: "${name} ${boolToString (getAttr name params)}") + concatMapStringsSep " " (name: "${name} ${boolToString (getAttr name params)}") (attrNames params); interfaceConfig = name: From 5d9073747a23c0d363a0a218d548bcfb411734c4 Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Fri, 10 Nov 2017 11:46:11 +0100 Subject: [PATCH 2/3] babeld module: support non-boolean default arguments Previosuly only boolean values would be rendered properly. All other values would cause an error. Even the example configuration did fail. --- nixos/modules/services/networking/babeld.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/networking/babeld.nix b/nixos/modules/services/networking/babeld.nix index 296de058cd9..807cdab494a 100644 --- a/nixos/modules/services/networking/babeld.nix +++ b/nixos/modules/services/networking/babeld.nix @@ -6,8 +6,10 @@ let cfg = config.services.babeld; + conditionalBoolToString = value: if (isBool value) then (boolToString value) else (toString value); + paramsString = params: - concatMapStringsSep " " (name: "${name} ${boolToString (getAttr name params)}") + concatMapStringsSep " " (name: "${name} ${conditionalBoolToString (getAttr name params)}") (attrNames params); interfaceConfig = name: From 5feed06535ec3c3949c298e74ff7d7fa335ee567 Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Fri, 10 Nov 2017 11:47:38 +0100 Subject: [PATCH 3/3] babeld module: updated example config Previosuly the example config did feature the deprecated `wired` paramter. Wired can now be configured using the `type` parameter. --- nixos/modules/services/networking/babeld.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/networking/babeld.nix b/nixos/modules/services/networking/babeld.nix index 807cdab494a..3dfd80f6ff5 100644 --- a/nixos/modules/services/networking/babeld.nix +++ b/nixos/modules/services/networking/babeld.nix @@ -51,7 +51,7 @@ in type = types.nullOr (types.attrsOf types.unspecified); example = { - wired = true; + type = "tunnel"; "split-horizon" = true; }; }; @@ -65,7 +65,7 @@ in type = types.attrsOf (types.attrsOf types.unspecified); example = { enp0s2 = - { wired = true; + { type = "wired"; "hello-interval" = 5; "split-horizon" = "auto"; };