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

more docs

+7 -4
+7 -4
docs/src/content/docs/guides/custom-classes.mdx
··· 29 29 each = host.users; 30 30 fromClass = _user: "user"; 31 31 intoClass = _user: class; # the class being resolved: nixos or darwin. 32 - intoPath = user: [ "users" "users" user.userName ] 32 + intoPath = user: [ "users" "users" user.userName ]; 33 33 fromAspect = user: den.aspects.${user.aspect}; 34 34 adaptArgs = os-args: { osConfig = os-args.config; }; 35 35 }; ··· 114 114 intoClass = _: class; 115 115 intoPath = _: [ "environment" "persistance" "/nix/persist/system" ]; 116 116 fromAspect = _: lib.head aspect-chain; 117 - guard = { options, ... }: options ? environment.persistance; 117 + guard = { options, ... }@osArgs: options ? environment.persistance; 118 118 }; 119 119 120 120 den.hosts.my-laptop.includes = [ persys ]; 121 121 122 122 # becomes nixos.environment.persistance."/nix/persist/system".hideMounts = true; 123 - den.hosts.my-laptop.persys.hideMounts = true; 123 + den.aspects.my-laptop.persys.hideMounts = true; 124 124 ``` 125 125 126 - When the guard returns `false`, forwarded settings are silently ignored. 126 + One cool thing about these custom classes is that aspects can simply define 127 + settings at them, without having to worry if the options they depend or 128 + some feature is enabled. The guard itself is reponsible for that check 129 + in only one place, instead of having `mkIf` in a lot of places. 127 130 128 131 ## Creating Your Own 129 132