···1212On [aspect oriented](https://vic.github.io/dendrix/Dendritic.html) [Dendritic](https://github.com/mightyiam/dendritic) setups, it is common to expose modules using `flake.modules.<class>.<aspect>`.
1313However, for humans, it might be more intuitive to use a transposed attrset `<aspect>.<class>`. Because it feels more natural to nest classes inside aspects than the other way around.
14141515-This project provides a [`transpose`](tree/main/default.nix) primitive, small and powerful enough to implement [cross-aspect dependencies](tree/main/aspects.nix) for *any* nix configuration class, and a [flake-parts module](./tree/main/flakeModule.nix) for turning `flake.aspects` into `flake.modules`.
1515+This project provides a [`transpose`](default.nix) primitive, small and powerful enough to implement [cross-aspect dependencies](aspects.nix) for *any* nix configuration class, and a [flake-parts module](flakeModule.nix) for turning `flake.aspects` into `flake.modules`.
16161717<table>
1818<tr>
···76767777### As a deps-free library from `./default.nix`:
78787979-Our [`transpose`](tree/main/default.nix) library takes an optional `emit` function that
7979+Our [`transpose`](default.nix) library takes an optional `emit` function that
8080can be used to ignore some items, modify them or produce many other items on its place.
81818282```nix
···8484transpose { a.b.c = 1; } # => { b.a.c = 1; }
8585```
86868787-This `emit` function is used by our [`aspects`](tree/main/aspects.nix) library
8787+This `emit` function is used by our [`aspects`](aspects.nix) library
8888(both libs are flakes-independent) to provide cross-aspects same-class module dependencies.
89899090### As a *Dendritic* flake-parts module that provides the `flake.aspects` option:
···126126127127#### Declaring cross-aspect dependencies
128128129129-`flake.aspects` also allow to dependencies between aspects.
129129+`flake.aspects` also allow **aspects** to declare dependencies between them.
130130131131Of course each module can have its own `imports`, however aspect requirements
132132are aspect-level instead of module-level. Dependencies will ultimately resolve to
···136136linux and macos hosts.
137137Note that `alice` prefers to use `nixos`+`homeManager`, while `bob` likes `darwin`+`hjem`.
138138139139-The `development-server` is a "usability concern", that configures the exact same
140140-development tools on two different OS.
141141-When it is applied to a NixOS machine, the `alice.nixos` module will likely
139139+The `development-server` aspect is a "_usability concern_", it configures the exact same
140140+development environment on two different OS.
141141+When applied to a NixOS machine, the `alice.nixos` module will likely
142142configure the alice user, but there is no nixos user for `bob`.
143143144144```nix
···197197When a module `flake.modules.nixos.foo` is requested (eg, included in a nixosConfiguration),
198198a corresponding module will be computed from `flake.aspects.foo.nixos`.
199199200200-`flake.aspects.foo.requires` is a list of functions (named **providers**)
201201-that will be called with `{name = "foo"; class = "nixos"}` to obtain another aspect
200200+`flake.aspects.foo.requires` is a list of functions (**providers**)
201201+that will be called with `{aspect = "foo"; class = "nixos"}` to obtain another aspect
202202providing a module having the same `class` (`nixos` in our example).
203203204204_providers_ are a way of asking: if I have a (`foo`, `nixos`) module what other
···212212This is why you can use the `with config; [ bar baz ]` syntax.
213213They are actually `[ config.bar.provides.itself config.baz.provides.itself ]`.
214214215215-but you can also define custom providers that can inspect the argument's `name` and `class`
215215+but you can also define custom providers that can inspect the argument's `aspect` and `class`
216216and return some another aspect accordingly.
217217218218```nix
219219-flake.aspects.alice.provides.os-user = { name, class, ... }: {
220220- # perhaps regexp matching on name or class. eg, match all "hosts" aspects.
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}
223223```