From 8d63d72b2d03e6e32b8e391809ec4af24b9a0f3b Mon Sep 17 00:00:00 2001 From: ibizaman Date: Fri, 30 Dec 2022 01:47:08 -0800 Subject: [PATCH] move function to utils --- haproxy/config.nix | 2 +- haproxy/configcreator.nix | 14 ++------------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/haproxy/config.nix b/haproxy/config.nix index 209a91f..880adc7 100644 --- a/haproxy/config.nix +++ b/haproxy/config.nix @@ -17,7 +17,7 @@ with lib.lists; with lib.strings; let - configcreator = pkgs.callPackage ./configcreator.nix {}; + configcreator = pkgs.callPackage ./configcreator.nix {inherit utils;}; in diff --git a/haproxy/configcreator.nix b/haproxy/configcreator.nix index 7c90d3d..5fca7e8 100644 --- a/haproxy/configcreator.nix +++ b/haproxy/configcreator.nix @@ -1,5 +1,6 @@ { lib , pkgs +, utils }: with builtins; @@ -7,6 +8,7 @@ with lib; with lib.attrsets; with lib.lists; with lib.strings; +with utils; let getAttrWithDefault = name: default: attrset: if isAttrs attrset && hasAttr name attrset then @@ -283,18 +285,6 @@ let concatStringsRecursive = sep: strings: concatStringsSep sep (flatten strings); - recursiveMerge = attrList: - let f = attrPath: - zipAttrsWith (n: values: - if all isList values then - concatLists values - else if all isAttrs values then - f (attrPath ++ [n]) values - else - last values - ); - in f [] attrList; - assertHasAttr = name: attrPath: v: assertMsg (hasAttrByPath attrPath v)