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.

more forward docs

+14 -12
+14 -12
docs/src/content/docs/guides/custom-classes.mdx
··· 43 43 44 44 | Parameter | Description | 45 45 |---|---| 46 - | `each` | List of items to forward (typically `[ user ]` or `[ true ]`) | 47 - | `fromClass` | The custom class name to read from | 48 - | `intoClass` | The target class to write into | 49 - | `intoPath` | Target attribute path in the target class| 50 - | `fromAspect` | The aspect to read the custom class from | 46 + | `each = items` | List of items to forward (typically `[ user ]` or `[ true ]`) | 47 + | `fromClass = item: class` | The custom class name to read from | 48 + | `intoClass = item: class` | The target class to write into | 49 + | `intoPath = item: path | args: path` | Target attribute path in the target class | 50 + | `fromAspect = item: aspect` | The aspect to read the custom class from | 51 51 52 52 53 53 ## Example: The Built-in `user` Class ··· 129 129 130 130 | Parameter | Description | 131 131 |---|---| 132 - | `guard` | Only forward when this predicate returns true | 133 - | `adaptArgs` | Transform module arguments before forwarding | 134 - | `adapterModule` | Custom module for the forwarded submodule type | 132 + | `guard = args: bool | item: mkIf` | Only forward when this predicate returns true | 133 + | `adaptArgs = args: attrs` | Transform module arguments before forwarding | 134 + | `adapterModule = deferredModule` | Custom module for the forwarded submodule type | 135 135 136 136 <Aside title="Guards reading config values"> 137 137 ··· 350 350 # only if environment.persistance option is present. 351 351 persys = { class, aspect-chain }: den._.forward { 352 352 each = lib.singleton true; 353 - fromClass = _: "persys"; 354 - intoClass = _: class; 355 - intoPath = _: [ "environment" "persistance" "/nix/persist/system" ]; 356 - fromAspect = _: lib.head aspect-chain; 353 + fromClass = _item: "persys"; 354 + intoClass = _item: class; 355 + intoPath = _item: 356 + { config, ... }: # access intoClass module arguments: 357 + [ "environment" "persistance" config.impermanence.persistence-dir ]; 358 + fromAspect = _item: lib.head aspect-chain; 357 359 guard = { options, ... }@osArgs: options ? environment.persistance; 358 360 }; 359 361