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

Update custom-classes.mdx

authored by oeiuwq.com and committed by

GitHub 21a1d36a 6b33935f

+33
+33
docs/src/content/docs/guides/custom-classes.mdx
··· 153 153 154 154 #### Example: A `nix` class that propagates settings to NixOS and HomeManager 155 155 156 + This can be used when you don't want NixOS and HomeManager to share the 157 + same pkgs but still configure both at the same time. 156 158 > Contributed by @musjj 157 159 158 160 ```nix ··· 176 178 177 179 # included at users who can fix things with nix. 178 180 den.aspects.tux.includes = [ nix-allowed ]; 181 + ``` 182 + 183 + #### Example: An `os` class forwarding to NixOS and nix-Darwin 184 + 185 + This forward class can be useful for settings that are common to both 186 + `nixos` and `darwin` classes. 187 + 188 + ```nix 189 + os-class = { host }: { class, aspect-chain }: den._.forward { 190 + each = lib.singleton true; 191 + fromClass = _: "os"; 192 + intoClass = _: host.class; 193 + intoPath = _: [ ]; # Forward at Top-Level 194 + fromAspect = lib.head aspect-chain; 195 + adaptArgs = lib.id; 196 + }; 197 + 198 + 199 + # enable on all hosts 200 + den.ctx.host.includes = [ os-class ]; 201 + 202 + # usage 203 + den.aspects.my-laptop = { 204 + nixos = {}; # nixos specific options 205 + darwin = {}; # darwin specific options 206 + 207 + # both on nixos and darwin 208 + os = { pkgs, ... }: { 209 + environment.packages = [ pkgs.hello ]; 210 + }; 211 + }; 179 212 ``` 180 213 181 214 #### Example: An impermanence class