nix-helpers: 2fb990382e89ab999863bd9804e7d156a45ecb0f
1: { die, dummyBuild, getType, isAttrSet, lexSort, lib }:
2:
3: with rec {
4: inherit (builtins) attrValues;
5: inherit (lib) concatLists mapAttrs;
6:
7: go = pred: path: val:
8: if isAttrSet val then
9: concatLists (attrValues (mapAttrs (name: go pred (path ++ [ name ])) val))
10: else if pred val then
11: [ path ]
12: else
13: [ ];
14: };
15: pred: val:
16: assert isAttrSet val || die {
17: error = "pathsTo should be given an attrset";
18: given = getType val;
19: };
20: lexSort (go pred [ ] val)
Generated by git2html.