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.

docs: host-only pattern to avoid dups

+26
+26
docs/src/content/docs/guides/bidirectional.mdx
··· 157 157 Read the documentation at [`context/user.nix`](https://github.com/vic/den/blob/main/modules/context/user.nix) for all the details. 158 158 </Aside> 159 159 160 + <Aside title="Avoid dups with host-only module pattern" icon="rocket"> 161 + Here's a pattern you can use to avoid duplication while `bidirectional` is enabled: 162 + 163 + ```nix 164 + den.aspects.igloo.includes = [ 165 + # wrap an aspect with perHost 166 + (den.lib.perHost igloo-only) 167 + 168 + # any other aspect can contribute to users 169 + shells 170 + music-production 171 + ]; 172 + 173 + # Use this aspect for host-only stuff, anything that would 174 + # lead to duplicates is safe in this list 175 + den.aspects.igloo-only = { 176 + includes = with den.aspects; [ facter disko ]; 177 + nixos = { pkgs, ... }: { 178 + environment.systemPackages = [ pkgs.hello ]; 179 + }; 180 + } 181 + ``` 182 + 183 + > Tip inspired by `@drupol`. 184 + </Aside> 185 + 160 186 ## `den.provides.mutual-provider` 161 187 162 188 An alternative to bidirectionality is [`den.provides.mutual-provider`](https://github.com/vic/den/blob/main/modules/aspects/provides/mutual-provider.nix).