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{
2 lib,
3 mkFlake,
4 evalMod,
5 ...
6}:
7{
8
9 flake.tests."test provides using fixpoints" =
10 let
11 flake = mkFlake {
12 flake.aspects =
13 { aspects, ... }@top:
14 {
15 aspectOne = {
16 classOne.bar = [ "1" ];
17 includes = [
18 aspects.aspectTwo
19 ];
20 };
21
22 aspectTwo = {
23 classOne.bar = [ "2" ];
24 includes = [ aspects.aspectTwo.provides.three-and-four-and-five ];
25 provides =
26 { aspects, ... }:
27 {
28 three-and-four-and-five = {
29 classOne.bar = [ "3" ];
30 includes = [
31 aspects.four
32 top.aspects.five
33 ];
34 };
35 four = {
36 classOne.bar = [ "4" ];
37 };
38 };
39 };
40
41 five.classOne.bar = [ "5" ];
42 };
43 };
44
45 expr = lib.sort (a: b: a < b) (evalMod "classOne" flake.modules.classOne.aspectOne).bar;
46 expected = [
47 "1"
48 "2"
49 "3"
50 "4"
51 "5"
52 ];
53 in
54 {
55 inherit expr expected;
56 };
57
58}