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 description = ''
4 The `os` class is a convenience for settings that should be forwarded
5 into both `nixos` and `darwin` classes.
6
7 This class is enabled by default.
8
9 # Usage
10
11 den.aspects.my-host = {
12 os.networking.hostName = "foo";
13 };
14
15 '';
16
17 os-class =
18 { class, aspect-chain }:
19 den._.forward {
20 each = [
21 "nixos"
22 "darwin"
23 ];
24 fromClass = _: "os";
25 intoClass = lib.id;
26 intoPath = _: [ ];
27 fromAspect = _: lib.head aspect-chain;
28 };
29
30in
31{
32 den.ctx.default.includes = [ os-class ];
33}