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

remove some __functors from code

+16 -21
+1 -2
checkmate/tests/aspect-functor.nix
··· 9 9 10 10 inherit (den.lib) parametric canTake; 11 11 12 - aspect-example = { 13 - __functor = parametric.atLeast; 12 + aspect-example = parametric.atLeast { 14 13 nixos.foo = 99; 15 14 includes = [ 16 15 { nixos.static = 100; }
+1 -1
modules/aspects/defaults.nix
··· 1 1 # creates den.default aspect 2 2 { lib, den, ... }: 3 3 { 4 - config.den.default.__functor = den.lib.parametric.atLeast; 4 + config.den.default = den.lib.parametric.atLeast { }; 5 5 options.den.default = lib.mkOption { 6 6 type = den.lib.aspects.types.aspectSubmodule; 7 7 };
+1 -2
modules/aspects/definition.nix
··· 8 8 inherit (den.lib) parametric; 9 9 10 10 makeAspect = from: { 11 - ${from.aspect} = { 11 + ${from.aspect} = parametric.atLeast { 12 12 ${from.class} = { }; 13 13 includes = [ den.default ]; 14 - __functor = parametric.atLeast; 15 14 }; 16 15 }; 17 16
+1 -2
modules/aspects/provides/define-user.nix
··· 44 44 }; 45 45 in 46 46 { 47 - den.provides.define-user = { 47 + den.provides.define-user = den.lib.parametric { 48 48 inherit description; 49 49 includes = [ 50 50 userContext 51 51 hmContext 52 52 ]; 53 - __functor = den.lib.parametric.atLeast; 54 53 }; 55 54 }
+9 -8
modules/aspects/provides/user-shell.nix
··· 30 30 31 31 in 32 32 { 33 - den.provides.user-shell = shell: { 34 - inherit description; 35 - __functor = den.lib.parametric.atLeast; 36 - includes = [ 37 - ({ user, ... }: userShell shell user) 38 - ({ home, ... }: userShell shell home) 39 - ]; 40 - }; 33 + den.provides.user-shell = 34 + shell: 35 + den.lib.parametric { 36 + inherit description; 37 + includes = [ 38 + ({ user, ... }: userShell shell user) 39 + ({ home, ... }: userShell shell home) 40 + ]; 41 + }; 41 42 }
+1 -2
templates/default/modules/aspects/eg/routes.nix
··· 25 25 26 26 routes = 27 27 { host, user, ... }@ctx: 28 - { 29 - __functor = parametric.fixedTo ctx; 28 + parametric.fixedTo ctx { 30 29 includes = [ 31 30 (mutual user host) 32 31 (mutual host user)
+2 -4
templates/examples/modules/_example/ci/parametric-with-owned.nix
··· 21 21 ]; 22 22 den.aspects.rockhopper.nixos.fwd.c = "host owned C"; 23 23 24 - # this is an `atLeast` parametric aspect that also includes 25 - # its owned configs and static (non-functional) includes. 26 - # Usage: just call `parametric` with an aspect. 27 - # or alternatively, set `__functor = den.lib.parametric;` 24 + # this aspect will take any context and also forward it 25 + # into any includes function that can take same context. 28 26 den.aspects.fwd._.first = parametric { 29 27 nixos.fwd.a = "First owned A"; 30 28 includes = [