fake.modules transposition for aspect-oriented Dendritic Nix. with cross-aspect dependencies. Discussions: https://oeiuwq.zulipchat.com/join/nqp26cd4kngon6mo3ncgnuap/ dendrix.oeiuwq.com/Dendritic.html
dendritic nix aspect oriented

Remove `provides.itself` references and change `.provides.` -> `._.` in readme (#13)

authored by

Peter Esselius and committed by
GitHub
4cbae79b e3e8a7cc

+7 -11
+7 -11
README.md
··· 86 86 nixos = {}; 87 87 darwin = {}; 88 88 89 - provides.emulation = { aspect, ... }: { 89 + _.emulation = { aspect, ... }: { 90 90 nixos = {}; 91 91 92 92 _.nes.nixos = {}; ··· 210 210 211 211 A provider can be either a static aspect object or a function that dynamically returns one. This mechanism enables sophisticated dependency chains, conditional logic, and parameterization. 212 212 213 - #### The Default Provider: `provides.itself` 214 - 215 - Every aspect automatically has a default provider called `itself`, located at `<aspect>.provides.itself`. This provider simply returns the aspect itself. 213 + #### Default Provider (`__functor`) 216 214 217 - The `with aspects; [ bar baz ]` syntax is a convenient shorthand that relies on this default: 215 + Each aspect is itself a provider via its hidden option `__functor` (see `nix/types.nix`). You can include aspects directly. 218 216 219 217 ```nix 220 218 # A 'foo' aspect that depends on 'bar' and 'baz' aspects. 221 219 flake.aspects = { aspects, ... }: { 222 220 foo.includes = with aspects; [ bar baz ]; 223 - # This is equivalent to: 224 - # foo.includes = [ aspects.bar.provides.itself aspects.baz.provides.itself ]; 225 221 } 226 222 ``` 227 223 ··· 232 228 In this example, the `kde-desktop` aspect defines a custom `karousel` provider that only returns a module if certain conditions are met: 233 229 234 230 ```nix 235 - flake.aspects.kde-desktop.provides.karousel = { aspect-chain, class }: 231 + flake.aspects.kde-desktop._.karousel = { aspect-chain, class }: 236 232 if someCondition aspect-chain && class == "nixos" then { nixos = { ... }; } else { }; 237 233 ``` 238 234 ··· 240 236 241 237 ```nix 242 238 flake.aspects = { aspects, ... }: { 243 - home-server.includes = [ aspects.kde-desktop.provides.karousel ]; 239 + home-server.includes = [ aspects.kde-desktop._.karousel ]; 244 240 } 245 241 ``` 246 242 ··· 256 252 flake.aspects = { aspects, ... }: { 257 253 system = { 258 254 nixos.system.stateVersion = "25.11"; 259 - provides.user = userName: { 255 + _.user = userName: { 260 256 darwin.system.primaryUser = userName; 261 257 nixos.users.${userName}.isNormalUser = true; 262 258 }; ··· 264 260 265 261 home-server.includes = [ 266 262 aspects.system 267 - (aspects.system.provides.user "bob") 263 + (aspects.system._.user "bob") 268 264 ]; 269 265 } 270 266 ```