Import all nix files in a directory tree. Discussions: https://oeiuwq.zulipchat.com/join/nqp26cd4kngon6mo3ncgnuap/ dendrix.oeiuwq.com/Dendritic.html
dendritic inputs

fix: addAPI extensions should be late bound (#14)

instead of always keeping a reference to when the extensions
were added.

authored by oeiuwq.com and committed by

GitHub e5a363c6 16710e6d

+13 -2
+10
checkmate.nix
··· 145 145 expected = [ ./tree/modules/hello-option/mod.nix ]; 146 146 }; 147 147 148 + addAPI."test API extensions are late bound" = { 149 + expr = 150 + let 151 + first = lit.addAPI { res = self: self.late; }; 152 + extended = first.addAPI { late = _self: "hello"; }; 153 + in 154 + extended.res; 155 + expected = "hello"; 156 + }; 157 + 148 158 pipeTo."test pipes list into a function" = { 149 159 expr = (lit.map lib.pathType).pipeTo (lib.length) ./tree/x; 150 160 expected = 1;
+3 -2
default.nix
··· 88 88 self: f: 89 89 let 90 90 __config = (f self); 91 + boundAPI = builtins.mapAttrs (_: g: g (self f)) __config.api; 91 92 in 92 - __config.api 93 + boundAPI 93 94 // { 94 95 inherit __config; 95 96 __functor = functor; ··· 101 102 matchNot = regex: self (c: mapAttr (f c) "filterf" (andNot (matchesRegex regex))); 102 103 map = mapf: self (c: mapAttr (f c) "mapf" (compose mapf)); 103 104 addPath = path: self (c: mapAttr (f c) "paths" (p: p ++ [ path ])); 104 - addAPI = api: self (c: mapAttr (f c) "api" (a: a // builtins.mapAttrs (_: g: g (self f)) api)); 105 + addAPI = api: self (c: mapAttr (f c) "api" (a: a // api)); 105 106 106 107 # Configuration updates (non-accumulating) 107 108 withLib = lib: self (c: (f c) // { inherit lib; });