tangled
alpha
login
or
join now
oeiuwq.com
/
flake-aspects
2
fork
atom
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
2
fork
atom
overview
issues
1
pulls
pipelines
remove unused export
oeiuwq.com
4 months ago
b67c2539
0c556be5
+48
-58
1 changed file
expand all
collapse all
unified
split
nix
types.nix
+48
-58
nix/types.nix
···
28
29
providerType = lib.types.either functionToAspect (lib.types.functionTo providerType);
30
31
-
aspectSubmodule = aspectSubmoduleWithModules [ ];
32
-
33
-
aspectSubmoduleWithModules =
34
-
otherModules:
35
-
lib.types.submoduleWith {
36
-
shorthandOnlyDefinesConfig = true;
37
-
modules = otherModules ++ [
38
-
(
39
-
{
40
-
name,
41
-
aspect,
42
-
config,
43
-
...
44
-
}:
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
45
{
46
-
freeformType = lib.types.attrsOf lib.types.deferredModule;
47
-
config._module.args.aspect = config;
48
-
options.name = lib.mkOption {
49
-
description = "Aspect name";
50
-
default = name;
51
-
type = lib.types.str;
52
-
};
53
-
options.description = lib.mkOption {
54
-
description = "Aspect description";
55
-
default = "Aspect ${name}";
56
-
type = lib.types.str;
57
-
};
58
-
options.includes = lib.mkOption {
59
-
description = "Providers to ask aspects from";
60
-
type = lib.types.listOf providerType;
61
-
default = [ ];
62
-
};
63
-
options.provides = lib.mkOption {
64
-
description = "Providers of aspect for other aspects";
65
-
default = { };
66
-
type = lib.types.submodule (
67
-
{ config, ... }:
68
-
{
69
-
freeformType = lib.types.attrsOf providerType;
70
-
config._module.args.provides = config;
71
-
options.itself = lib.mkOption {
72
-
readOnly = true;
73
-
description = "Provides itself";
74
-
type = providerType;
75
-
default = _: aspect;
76
-
};
77
-
}
78
-
);
79
-
};
80
-
options.__functor = lib.mkOption {
81
-
internal = true;
82
-
visible = false;
83
-
description = "Functor to default provider";
84
-
type = lib.types.functionTo providerType;
85
-
default = _: aspect.provides.itself;
86
};
87
}
88
-
)
89
-
];
90
-
};
0
0
0
0
0
0
0
0
91
92
in
93
{
94
inherit
95
aspectsType
96
aspectSubmodule
97
-
aspectSubmoduleWithModules
98
providerType
99
;
100
}
···
28
29
providerType = lib.types.either functionToAspect (lib.types.functionTo providerType);
30
31
+
aspectSubmodule = lib.types.submodule (
32
+
{
33
+
name,
34
+
aspect,
35
+
config,
36
+
...
37
+
}:
38
+
{
39
+
freeformType = lib.types.attrsOf lib.types.deferredModule;
40
+
config._module.args.aspect = config;
41
+
options.name = lib.mkOption {
42
+
description = "Aspect name";
43
+
default = name;
44
+
type = lib.types.str;
45
+
};
46
+
options.description = lib.mkOption {
47
+
description = "Aspect description";
48
+
default = "Aspect ${name}";
49
+
type = lib.types.str;
50
+
};
51
+
options.includes = lib.mkOption {
52
+
description = "Providers to ask aspects from";
53
+
type = lib.types.listOf providerType;
54
+
default = [ ];
55
+
};
56
+
options.provides = lib.mkOption {
57
+
description = "Providers of aspect for other aspects";
58
+
default = { };
59
+
type = lib.types.submodule (
60
+
{ config, ... }:
61
{
62
+
freeformType = lib.types.attrsOf providerType;
63
+
config._module.args.provides = config;
64
+
options.itself = lib.mkOption {
65
+
readOnly = true;
66
+
description = "Provides itself";
67
+
type = providerType;
68
+
default = _: aspect;
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
69
};
70
}
71
+
);
72
+
};
73
+
options.__functor = lib.mkOption {
74
+
internal = true;
75
+
visible = false;
76
+
description = "Functor to default provider";
77
+
type = lib.types.functionTo providerType;
78
+
default = _: aspect.provides.itself;
79
+
};
80
+
}
81
+
);
82
83
in
84
{
85
inherit
86
aspectsType
87
aspectSubmodule
0
88
providerType
89
;
90
}