Modular, context-aware and aspect-oriented dendritic Nix configurations. Discussions: https://oeiuwq.zulipchat.com/join/nqp26cd4kngon6mo3ncgnuap/
at main 38 lines 861 B view raw
1{ lib, ... }: 2let 3 4 # Example: configuration that depends on both host and user. provides anytime { user, host } is in context. 5 user-to-host-conditional = 6 { user, host, ... }: 7 if user.userName == "alice" && !lib.hasSuffix "darwin" host.system then 8 { 9 nixos.programs.tmux.enable = true; 10 } 11 else 12 { }; 13in 14{ 15 16 # Example: user provides parametric host configuration. 17 den.aspects.alice.includes = [ 18 user-to-host-conditional 19 ]; 20 21 perSystem = 22 { 23 checkCond, 24 rockhopper, 25 honeycrisp, 26 ... 27 }: 28 { 29 checks.alice-os-tmux-enabled-on = checkCond "os tmux for hosts having alice" ( 30 rockhopper.config.programs.tmux.enable 31 ); 32 checks.alice-os-tmux-enabled-off = checkCond "os tmux for hosts having alice" ( 33 !honeycrisp.config.programs.tmux.enable 34 ); 35 36 }; 37 38}