diff --git a/pkgs/lib/default.nix b/pkgs/lib/default.nix index ca90f957761..2d300891bcf 100644 --- a/pkgs/lib/default.nix +++ b/pkgs/lib/default.nix @@ -222,6 +222,19 @@ rec { in uniqList {outputList=newOutputList; inputList = (tail inputList);}; + uniqListExt = {inputList, outputList ? [], + getter ? (x : x), compare ? (x: y: x==y)}: + if (inputList == []) then outputList else + let x=head inputList; + isX = y: (compare (getter y) (getter x)); + newOutputList = outputList ++ + (if any isX outputList then [] else [x]); + in uniqListExt {outputList=newOutputList; + inputList = (tail inputList); + inherit getter compare; + }; + + condConcat = name: list: checker: if list == [] then name else