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.

example feature detection between hosts

+44
+44
templates/ci/modules/features/resolve-adapters.nix
··· 51 51 } 52 52 ); 53 53 54 + test-host-conditional-aspect-inclusion = denTest ( 55 + { 56 + den, 57 + lib, 58 + iceberg, 59 + ... 60 + }: 61 + { 62 + den.hosts.x86_64-linux.igloo = { }; 63 + den.hosts.x86_64-linux.iceberg = { }; 64 + 65 + den.aspects.foo.meta.key = "foo"; 66 + den.aspects.foo.nixos.environment.sessionVariables.message = "foo"; 67 + 68 + den.aspects.bar.nixos.environment.sessionVariables.message = "bar"; 69 + 70 + # host igloo includes foo 71 + den.aspects.igloo.includes = [ den.aspects.foo ]; 72 + 73 + # host iceberg feature detects if foo is available at host igloo 74 + den.aspects.iceberg.includes = 75 + let 76 + inherit (den.lib.aspects) resolve; 77 + inherit (den.hosts.x86_64-linux) igloo; 78 + 79 + iglooAspect = den.ctx.host { host = igloo; }; 80 + detectFoo = resolve.withAdapter (hasAspectWithKey "foo") "nixos" iglooAspect; 81 + 82 + hasAspectWithKey = 83 + key: 84 + { aspect, recurse, ... }: 85 + { 86 + found = 87 + aspect.meta.key or null == key || lib.any (i: (recurse i).found or false) (aspect.includes or [ ]); 88 + }; 89 + 90 + in 91 + lib.optional detectFoo.found den.aspects.bar; 92 + 93 + expr = iceberg.environment.sessionVariables.message; 94 + expected = "bar"; 95 + } 96 + ); 97 + 54 98 }; 55 99 }