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
1{ den, lib, ... }:
2let
3 inherit (den.lib.parametric) fixedTo;
4
5 ctx.host.description = ''
6 ## Context: den.ctx.host{host}
7
8 Host context stage configures an OS
9
10 A {host} context fan-outs into many {host,user} contexts.
11
12 A `den.ctx.host{host}` transitions unconditionally into `den.ctx.default{host}`
13
14 A `den.ctx.host{host}` obtains OS configuration nixos/darwin by using `fixedTo{host} host-aspect`.
15 fixedTo takes:
16 - host-aspect's owned attrs
17 - static includes like { nixos.foo = ... } or ({ class, aspect-chain }: { nixos.foo = ...; })
18 - atLeast{host} parametric includes like ({ host }: { nixos.foo = ...; })
19 '';
20
21 ctx.host.into.user = { host }: map (user: { inherit host user; }) (lib.attrValues host.users);
22 ctx.host.into.default = lib.singleton;
23 ctx.host.provides.host = { host }: fixedTo { inherit host; } host.aspect;
24
25in
26{
27 den.ctx = ctx;
28}