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{ lib, ... }:
2let
3 # Example: configuration that depends on both host and user. provides only to HM.
4 host-to-user-conditional =
5 {
6 user,
7 host,
8 ...
9 }:
10 if user.userName == "alice" && !lib.hasSuffix "darwin" host.system then
11 {
12 homeManager.programs.git.enable = true;
13 }
14 else
15 { };
16in
17{
18
19 den.aspects.rockhopper.includes = [
20 # Example: host provides parametric user configuration.
21 host-to-user-conditional
22 ];
23
24 perSystem =
25 {
26 checkCond,
27 alice-at-rockhopper,
28 alice-at-honeycrisp,
29 ...
30 }:
31 {
32
33 checks.alice-hm-git-enabled-on = checkCond "home-managed git for alice at rockhopper" (
34 alice-at-rockhopper.programs.git.enable
35 );
36 checks.alice-hm-git-enabled-off = checkCond "home-managed git for alice at honeycrisp" (
37 !alice-at-honeycrisp.programs.git.enable
38 );
39
40 };
41
42}