Modular, context-aware and aspect-oriented dendritic Nix configurations. Discussions: https://oeiuwq.zulipchat.com/join/nqp26cd4kngon6mo3ncgnuap/
at main 29 lines 698 B view raw
1{ 2 den.default.includes = 3 let 4 # Example: parametric host aspect to automatically set hostName on any host. 5 set-host-name = 6 { host, ... }: 7 { 8 ${host.class}.networking.hostName = host.name; 9 }; 10 in 11 [ set-host-name ]; 12 13 perSystem = 14 { 15 checkCond, 16 rockhopper, 17 honeycrisp, 18 ... 19 }: 20 { 21 checks.rockhopper-hostname = checkCond "den.default.host.includes sets hostName" ( 22 rockhopper.config.networking.hostName == "rockhopper" 23 ); 24 25 checks.honeycrisp-hostname = checkCond "den.default.host.includes sets hostName" ( 26 honeycrisp.config.networking.hostName == "honeycrisp" 27 ); 28 }; 29}