fake.modules transposition for aspect-oriented Dendritic Nix. with cross-aspect dependencies. Discussions: https://oeiuwq.zulipchat.com/join/nqp26cd4kngon6mo3ncgnuap/
dendrix.oeiuwq.com/Dendritic.html
dendritic
nix
aspect
oriented
1{ lib, targetLib, ... }:
2{
3
4 flake.tests."test usage without flakes" =
5 let
6 flake-aspects-lib = import targetLib lib;
7 # first eval is like evaling the flake.
8 first = lib.evalModules {
9 modules = [
10 (flake-aspects-lib.new-scope "hello")
11 {
12 hello.aspects =
13 { aspects, ... }:
14 {
15 a.b.c = [ "world" ];
16 a.includes = [ aspects.x ];
17 x.b =
18 { lib, ... }:
19 {
20 c = lib.splitString " " "mundo cruel";
21 };
22 };
23 }
24 ];
25 };
26 # second eval is like evaling its nixosConfiguration
27 second = lib.evalModules {
28 modules = [
29 { options.c = lib.mkOption { type = lib.types.listOf lib.types.str; }; }
30 first.config.hello.modules.b.a
31 ];
32 };
33 expr = lib.sort (a: b: a < b) second.config.c;
34 expected = [
35 "cruel"
36 "mundo"
37 "world"
38 ];
39 in
40 {
41 inherit expr expected;
42 };
43
44}