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
8
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(batteries): allow mutual-provider pass ctx to generic aspect (#285)

authored by

Victor Borja and committed by
GitHub
9130efc5 f2fd0622

+16 -19
+10 -15
modules/aspects/provides/mutual-provider.nix
··· 49 49 ''; 50 50 51 51 find-mutual = from: to: den.aspects.${from.aspect}._.${to.aspect} or { }; 52 - user-to-hosts = { host, user }: den.aspects.${user.aspect}._.to-hosts or { }; 53 - host-to-users = { host, user }: den.aspects.${host.aspect}._.to-users or { }; 52 + user-to-hosts = user: den.aspects.${user.aspect}._.to-hosts or { }; 53 + host-to-users = host: den.aspects.${host.aspect}._.to-users or { }; 54 54 55 - named-mutuals = 55 + in 56 + { 57 + den.provides.mutual-provider = take.exactly ( 56 58 { host, user }@ctx: 57 59 parametric.fixedTo ctx { 60 + inherit description; 58 61 includes = [ 59 62 (find-mutual host user) 60 63 (find-mutual user host) 64 + (host-to-users host) 65 + (user-to-hosts user) 61 66 ]; 62 - }; 63 - 64 - in 65 - { 66 - den.provides.mutual-provider = parametric.exactly { 67 - inherit description; 68 - includes = [ 69 - named-mutuals 70 - host-to-users 71 - user-to-hosts 72 - ]; 73 - }; 67 + } 68 + ); 74 69 }
+6 -4
templates/ci/modules/features/batteries/mutual-provider.nix
··· 74 74 homeManager.home.keyboard.model = "denboard"; 75 75 }; 76 76 77 - den.aspects.tux.provides.to-hosts = { 78 - nixos.boot.kernel.randstructSeed = "denseed"; 79 - }; 77 + den.aspects.tux.provides.to-hosts = 78 + { host, ... }: 79 + { 80 + nixos.boot.kernel.randstructSeed = "denseed@${host.name}"; 81 + }; 80 82 81 83 expr = [ 82 84 igloo.boot.kernel.randstructSeed ··· 84 86 ]; 85 87 86 88 expected = [ 87 - "denseed" 89 + "denseed@igloo" 88 90 "denboard" 89 91 ]; 90 92 }