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

fix: den.fwd.adapter.user already defined (#202)

Failing test for #201

authored by oeiuwq.com and committed by

GitHub 7d57973e 6ce35e10

+48 -2
+4 -2
modules/aspects/provides/forward.nix
··· 53 53 freeformMod = { 54 54 config._module.freeformType = lib.types.lazyAttrsOf lib.types.unspecified; 55 55 }; 56 + adapterKey = lib.concatStringsSep "_" intoPath; 56 57 adapter = { 57 58 includes = [ 58 59 (den.lib.aspects.forward ( ··· 63 64 "fwd" 64 65 "adapter" 65 66 fromClass 67 + adapterKey 66 68 ]; 67 69 } 68 70 )) 69 71 ]; 70 72 ${intoClass} = args: { 71 - options.den.fwd.adapter.${fromClass} = lib.mkOption { 73 + options.den.fwd.adapter.${fromClass}.${adapterKey} = lib.mkOption { 72 74 default = { }; 73 75 type = lib.types.submoduleWith { 74 76 specialArgs = if adaptArgs == null then args else adaptArgs args; ··· 77 79 }; 78 80 config = 79 81 if (guard == null || guard args) then 80 - lib.setAttrByPath intoPath args.config.den.fwd.adapter.${fromClass} 82 + lib.setAttrByPath intoPath args.config.den.fwd.adapter.${fromClass}.${adapterKey} 81 83 else 82 84 { }; 83 85 };
+44
templates/ci/modules/features/deadbugs/issue-201-forward-multiple-users.nix
··· 1 + { denTest, ... }: 2 + { 3 + 4 + # See den#201 5 + flake.tests.deadbugs-issue-201 = { 6 + 7 + test-forward-two-users = denTest ( 8 + { 9 + den, 10 + lib, 11 + igloo, 12 + ... 13 + }: 14 + { 15 + den.default.homeManager.home.stateVersion = "25.11"; 16 + 17 + den.hosts.x86_64-linux.igloo.users = { 18 + tux = { }; 19 + pingu = { }; 20 + }; 21 + 22 + den.aspects.igloo.includes = [ 23 + den._.define-user 24 + den.aspects.set-user-desc 25 + ]; 26 + den.aspects.tux.includes = [ den._.primary-user ]; 27 + 28 + den.aspects.set-user-desc = 29 + { host, user }: 30 + { 31 + ${host.class}.users.users.${user.userName}.description = "User ${user.userName}"; 32 + }; 33 + 34 + expr = { 35 + tux = igloo.users.users.tux.description; 36 + }; 37 + expected = { 38 + tux = "User tux"; 39 + }; 40 + } 41 + ); 42 + }; 43 + 44 + }