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 resolve documentation

+7 -8
+1 -1
docs/src/content/docs/explanation/aspects.mdx
··· 95 95 Aspects are resolved for a specific class using the `resolve` API from flake-aspects: 96 96 97 97 ```nix 98 - module = den.aspects.igloo.resolve { class = "nixos"; }; 98 + module = den.lib.aspects.resolve "nixos" [] den.aspects.igloo; 99 99 ``` 100 100 101 101 Resolution collects all `nixos` attrs from owned configs, walks `includes`
+1 -1
docs/src/content/docs/explanation/library-vs-framework.mdx
··· 51 51 52 52 # Resolve for your custom class 53 53 aspect = den.aspects.web-server { env = "production"; }; 54 - module = aspect.resolve { class = "terranix"; }; 54 + module = den.lib.aspects.resolve "terranix" [] aspect; 55 55 ``` 56 56 57 57 ## Den as a Framework
+2 -2
docs/src/content/docs/guides/debug.md
··· 62 62 Test how an aspect resolves for a specific class: 63 63 64 64 ```console 65 - nix-repl> module = den.aspects.laptop.resolve { class = "nixos"; aspect-chain = []; } 65 + nix-repl> module = den.lib.aspects.resolve "nixos" [] den.aspects.laptop; 66 66 nix-repl> config = (lib.evalModules { modules = [ module ]; }).config 67 67 ``` 68 68 ··· 70 70 71 71 ```console 72 72 nix-repl> aspect = den.aspects.laptop { host = den.hosts.x86_64-linux.laptop; } 73 - nix-repl> module = aspect.resolve { class = "nixos"; aspect-chain = []; } 73 + nix-repl> module = den.lib.aspects.resolve "nixos" [] aspect; 74 74 ``` 75 75 76 76 ## Inspect a Host's Main Module
+2 -2
docs/src/content/docs/index.mdx
··· 135 135 # Use Den API -- Context transformations happen here, nothing is configured yet. 136 136 aspect = den.ctx.host { host = den.hosts.x86_64-linux.igloo; }; 137 137 138 - # Use flake-aspects API -- We enter the NixOS domain by resolving for the "nixos" class. 139 - nixosModule = aspect.resolve { class = "nixos"; }; 138 + # Use flake-aspects API (re-exported by Den) -- We enter the NixOS domain by resolving for the "nixos" class. 139 + nixosModule = den.lib.aspects.resolve "nixos" [] aspect; 140 140 141 141 # Use NixOS API -- Instantiate using nixosSystem with the resolved module. 142 142 nixosConfigurations.igloo = lib.nixosSystem { modules = [ nixosModule ]; };
+1 -1
templates/bogus/modules/test-base.nix
··· 59 59 funnyNames = 60 60 aspect: 61 61 let 62 - mod = aspect.resolve { class = "funny"; }; 62 + mod = config.den.lib.aspects.resolve "funny" [ ] aspect; 63 63 namesMod = { 64 64 options.names = lib.mkOption { 65 65 type = lib.types.listOf lib.types.str;
-1
templates/microvm/modules/guests-example.nix
··· 23 23 }; 24 24 25 25 den.aspects.guest-microvm = { 26 - # resolved with: `(den.ctx.host = { host = guest-microvm }).resolve { class = "nixos" }` 27 26 # resulting nixos-module is set at server: microvm.vms.<name>.config 28 27 nixos = 29 28 { pkgs, ... }: