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
at noflake 52 lines 814 B view raw
1{ 2 den, 3 ... 4}: 5let 6 inherit (den.lib) 7 owned 8 statics 9 take 10 ; 11 12 dependencies = [ 13 (take.exactly osDependencies) 14 ]; 15 16 osDependencies = 17 { OS, host }: 18 { 19 includes = [ 20 (owned den.default) 21 (statics den.default) 22 (owned OS) 23 (statics OS) 24 { 25 includes = 26 let 27 users = builtins.attrValues host.users; 28 contrib = osUserDependencies { inherit OS host; }; 29 in 30 map contrib users; 31 } 32 ]; 33 }; 34 35 osUserDependencies = 36 { OS, host }: 37 user: 38 let 39 USR = den.aspects.${user.aspect}; 40 in 41 { 42 includes = [ 43 (owned USR) 44 (statics USR) 45 (USR { inherit OS host user; }) 46 ]; 47 }; 48 49in 50{ 51 den.default.includes = dependencies; 52}