Modular, context-aware and aspect-oriented dendritic Nix configurations. Discussions: https://oeiuwq.zulipchat.com/join/nqp26cd4kngon6mo3ncgnuap/ den.oeiuwq.com
configurations den dendritic nix aspect oriented
8
fork

Configure Feed

Select the types of activity you want to include in your feed.

move lib to nix and expose on flake

+34 -35
+2 -1
flake.nix
··· 1 1 { 2 - outputs = _: { 2 + outputs = _inputs: { 3 3 flakeModule = ./nix/flakeModule.nix; 4 4 templates.default = { 5 5 path = ./templates/default; 6 6 description = "Minimal nixos configuration"; 7 7 }; 8 8 packages = import ./nix/template-packages.nix; 9 + lib = import ./nix/lib.nix; 9 10 }; 10 11 }
+1 -34
modules/lib.nix
··· 1 1 { 2 2 lib, 3 3 inputs, 4 - config, 5 4 ... 6 5 }: 7 - let 8 - # "Just Give 'Em One of These" - Moe Szyslak 9 - funk = import ../nix/aspect-functor.nix lib; 10 - 11 - parametric = 12 - param: aspect: 13 - if param == true then 14 - funk aspect 15 - else 16 - # deadnix: skip 17 - { class, aspect-chain }: funk aspect param; 18 - 19 - aspects = inputs.flake-aspects.lib lib; 20 - 21 - # EXPERIMENTAL. __findFile to resolve deep aspects. 22 - # __findFile = angleBrackets den.aspects; 23 - # <foo/bar/baz> => den.aspects.foo.provides.bar.provides.baz 24 - # inspired by https://fzakaria.com/2025/08/10/angle-brackets-in-a-nix-flake-world 25 - angleBrackets = 26 - den-ns: _nixPath: name: 27 - lib.pipe name [ 28 - (lib.replaceString "/" ".provides.") 29 - (lib.splitString ".") 30 - (path: lib.getAttrFromPath path den-ns) 31 - ]; 32 - in 33 6 { 34 - config.den.lib = { 35 - inherit parametric aspects angleBrackets; 36 - 37 - # default angle brackets search from den.aspects 38 - __findFile = angleBrackets config.den.aspects; 39 - }; 7 + config.den.lib = inputs.den.lib lib inputs; 40 8 options.den.lib = lib.mkOption { 41 - readOnly = true; 42 9 internal = true; 43 10 visible = false; 44 11 type = lib.types.attrsOf lib.types.raw;
+31
nix/lib.nix
··· 1 + lib: inputs: 2 + let 3 + # "Just Give 'Em One of These" - Moe Szyslak 4 + funk = import ./aspect-functor.nix lib; 5 + 6 + parametric = 7 + param: aspect: 8 + if param == true then 9 + funk aspect 10 + else 11 + # deadnix: skip 12 + { class, aspect-chain }: funk aspect param; 13 + 14 + aspects = inputs.flake-aspects.lib lib; 15 + 16 + # EXPERIMENTAL. __findFile to resolve deep aspects. 17 + # __findFile = angleBrackets den.aspects; 18 + # <foo/bar/baz> => den.aspects.foo.provides.bar.provides.baz 19 + # inspired by https://fzakaria.com/2025/08/10/angle-brackets-in-a-nix-flake-world 20 + angleBrackets = 21 + den-ns: _nixPath: name: 22 + lib.pipe name [ 23 + (lib.replaceString "/" ".provides.") 24 + (lib.splitString ".") 25 + (path: lib.getAttrFromPath path den-ns) 26 + ]; 27 + 28 + in 29 + { 30 + inherit parametric aspects angleBrackets; 31 + }