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