···213213They are actually `[ config.bar.provides.itself config.baz.provides.itself ]`.
214214215215but you can also define custom providers that can inspect the argument's `aspect` and `class`
216216-and return some another aspect accordingly.
216216+and return some set of modules accordingly. you can also use this feature to have aspects that
217217+like as proxy/routers of dependencies.
217218218219```nix
219219-flake.aspects.alice.provides.os-user = { aspect, class, ... }: {
220220- # perhaps regexp matching on aspect or class. eg, match all "hosts" aspects.
221221- nixos = { };
222222-}
220220+flake.aspects.alice.provides.os-user = { aspect, class }:
221221+if someCondition aspect && class == "nixos" then { nixos = { ... }; } else { }
223222```
224223225224the `os-user` provider can be now included in a `requires` list:
+37-1
checkmate.nix
···116116 inherit expr expected;
117117 };
118118119119- aspects."test providers" =
119119+ aspects."test requirements on aspects" =
120120 let
121121 flake = mkFlake ({
122122 flake.aspects =
···138138 expected = [
139139 "os"
140140 "user"
141141+ ];
142142+ in
143143+ {
144144+ inherit expr expected;
145145+ };
146146+147147+ aspects."test provider arguments" =
148148+ let
149149+ flake = mkFlake ({
150150+ flake.aspects =
151151+ { config, ... }:
152152+ {
153153+ aspectOne.requires = with config.aspectTwo.provides; [
154154+ foo
155155+ bar
156156+ ];
157157+ aspectOne.classOne = { }; # required for mixing dependencies.
158158+ aspectTwo = {
159159+ classOne.bar = [ "class one not included" ];
160160+ classTwo.bar = [ "class two not included" ];
161161+ provides.foo =
162162+ { class, aspect }:
163163+ {
164164+ classOne.bar = [ "foo:${aspect}:${class}" ];
165165+ classTwo.bar = [ "foo class two not included" ];
166166+ };
167167+ provides.bar = _: {
168168+ # classOne is missing on bar
169169+ classTwo.bar = [ "bar class two not included" ];
170170+ };
171171+ };
172172+ };
173173+ });
174174+ expr = lib.sort (a: b: a < b) (evalMod "classOne" flake.modules.classOne.aspectOne).bar;
175175+ expected = [
176176+ "foo:aspectOne:classOne"
141177 ];
142178 in
143179 {