1
0
Fork 0

move function to utils

This commit is contained in:
ibizaman 2022-12-30 01:47:08 -08:00
parent 414d80d105
commit 8d63d72b2d
2 changed files with 3 additions and 13 deletions

View file

@ -17,7 +17,7 @@ with lib.lists;
with lib.strings;
let
configcreator = pkgs.callPackage ./configcreator.nix {};
configcreator = pkgs.callPackage ./configcreator.nix {inherit utils;};
in

View file

@ -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)