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
1
pipelines
Add example to readme
oeiuwq.com
6 days ago
66fba202
39e8df95
1/1
mirror.yml
success
4s
+33
-2
1 changed file
expand all
collapse all
unified
split
README.md
+33
-2
README.md
···
250
250
from any file, without any `mkIf`/`mkMerge` cluttering. The logic for
251
251
determining if the class takes effect is defined at a single place.
252
252
253
253
-
> Example inspired by @Doc-Steve
253
253
+
#### Example: Platform Aware `homeManager` classes
254
254
+
255
255
+
This uses `pkgs.stdenv.isXYZ` to define `hmXYZ` classes,
256
256
+
because some hm configurations might be only available
257
257
+
on specific platforms.
258
258
+
259
259
+
```nix
260
260
+
hmPlatforms =
261
261
+
{ class, aspect-chain }:
262
262
+
den._.forward {
263
263
+
each = [ "Linux" "Darwin" ];
264
264
+
fromClass = platform: "hm${platform}";
265
265
+
intoClass = _: "homeManager";
266
266
+
intoPath = _: [ ];
267
267
+
fromAspect = _: lib.head aspect-chain;
268
268
+
guard = { pkgs, ... }: platform: lib.mkIf pkgs.stdenv."is${platform}";
269
269
+
adaptArgs = { config, ... }: { osConfig = config; };
270
270
+
};
271
271
+
272
272
+
den.hosts.x86_64-linux.igloo.users.tux = { };
273
273
+
den.hosts.aarch64-darwin.apple.users.tux = { };
274
274
+
275
275
+
den.aspects.tux = {
276
276
+
includes = [ hmPlatforms ];
277
277
+
hmDarwin = { pkgs, ... }: { home.packages = [ pkgs.iterm2 ]; };
278
278
+
hmLinux = { pkgs, ... }: { home.packages = [ pkgs.wl-clipboard-rs ]; };
279
279
+
};
280
280
+
```
281
281
+
282
282
+
#### Example: Class for Impermanence Capability
283
283
+
284
284
+
> Inspired by @Doc-Steve
254
285
255
286
```nix
256
287
# Aspects use the `persys` class without any conditional. And guard guarantees
···
271
302
den.aspects.my-laptop.persys.hideMounts = true;
272
303
```
273
304
274
274
-
### User-defined Extensions to Den Framework.
305
305
+
### User-defined Extensions to Den context pipeline.
275
306
276
307
See example [`template/microvm`](https://den.oeiuwq.com/tutorials/microvm) for an example
277
308
of custom `den.ctx` and `den.schema` extensions for supporting