tangled
alpha
login
or
join now
oeiuwq.com
/
den
8
fork
atom
Modular, context-aware and aspect-oriented dendritic Nix configurations. Discussions: https://oeiuwq.zulipchat.com/join/nqp26cd4kngon6mo3ncgnuap/
den.oeiuwq.com
configurations
den
dendritic
nix
aspect
oriented
8
fork
atom
overview
issues
4
pulls
2
pipelines
more docs
oeiuwq.com
1 week ago
27804667
9915537d
1/1
mirror.yml
success
8d ago
+7
-4
1 changed file
expand all
collapse all
unified
split
docs
src
content
docs
guides
custom-classes.mdx
+7
-4
docs/src/content/docs/guides/custom-classes.mdx
···
29
29
each = host.users;
30
30
fromClass = _user: "user";
31
31
intoClass = _user: class; # the class being resolved: nixos or darwin.
32
32
-
intoPath = user: [ "users" "users" user.userName ]
32
32
+
intoPath = user: [ "users" "users" user.userName ];
33
33
fromAspect = user: den.aspects.${user.aspect};
34
34
adaptArgs = os-args: { osConfig = os-args.config; };
35
35
};
···
114
114
intoClass = _: class;
115
115
intoPath = _: [ "environment" "persistance" "/nix/persist/system" ];
116
116
fromAspect = _: lib.head aspect-chain;
117
117
-
guard = { options, ... }: options ? environment.persistance;
117
117
+
guard = { options, ... }@osArgs: options ? environment.persistance;
118
118
};
119
119
120
120
den.hosts.my-laptop.includes = [ persys ];
121
121
122
122
# becomes nixos.environment.persistance."/nix/persist/system".hideMounts = true;
123
123
-
den.hosts.my-laptop.persys.hideMounts = true;
123
123
+
den.aspects.my-laptop.persys.hideMounts = true;
124
124
```
125
125
126
126
-
When the guard returns `false`, forwarded settings are silently ignored.
126
126
+
One cool thing about these custom classes is that aspects can simply define
127
127
+
settings at them, without having to worry if the options they depend or
128
128
+
some feature is enabled. The guard itself is reponsible for that check
129
129
+
in only one place, instead of having `mkIf` in a lot of places.
127
130
128
131
## Creating Your Own
129
132