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

use providerType in aspects

+16 -17
+2 -1
.github/workflows/test.yml
··· 8 runs-on: ubuntu-latest 9 steps: 10 - uses: cachix/install-nix-action@v30 11 - - run: nix flake check -L github:$GITHUB_REPOSITORY/$GITHUB_SHA?dir=checkmate --override-input target github:$GITHUB_REPOSITORY/$GITHUB_SHA
··· 8 runs-on: ubuntu-latest 9 steps: 10 - uses: cachix/install-nix-action@v30 11 + - uses: actions/checkout@v5 12 + - run: nix flake check -L ./checkmate --override-input target .
+10 -6
checkmate/flake.lock
··· 128 }, 129 "target": { 130 "locked": { 131 - "path": "..", 132 - "type": "path" 133 }, 134 "original": { 135 - "path": "..", 136 - "type": "path" 137 - }, 138 - "parent": [] 139 }, 140 "treefmt-nix": { 141 "inputs": {
··· 128 }, 129 "target": { 130 "locked": { 131 + "lastModified": 1763763502, 132 + "narHash": "sha256-J78S02ZbBclWz7WKF8C+kHUca9/KdHtSeRgO/WF9LjY=", 133 + "owner": "vic", 134 + "repo": "flake-aspects", 135 + "rev": "83c8e44186bc9631509a55cf5a053950ecd3dc30", 136 + "type": "github" 137 }, 138 "original": { 139 + "owner": "vic", 140 + "repo": "flake-aspects", 141 + "type": "github" 142 + } 143 }, 144 "treefmt-nix": { 145 "inputs": {
+1 -1
checkmate/flake.nix
··· 3 outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./modules); 4 5 inputs = { 6 - target.url = "path:.."; 7 flake-parts = { 8 inputs.nixpkgs-lib.follows = "nixpkgs-lib"; 9 url = "github:hercules-ci/flake-parts";
··· 3 outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./modules); 4 5 inputs = { 6 + target.url = "github:vic/flake-aspects"; 7 flake-parts = { 8 inputs.nixpkgs-lib.follows = "nixpkgs-lib"; 9 url = "github:hercules-ci/flake-parts";
+3 -9
nix/types.nix
··· 5 aspectsType = lib.types.submodule ( 6 { config, ... }: 7 { 8 - freeformType = lib.types.attrsOf (lib.types.either aspectSubmoduleAttrs providerType); 9 config._module.args.aspects = config; 10 } 11 ); ··· 30 ); 31 32 functionProviderType = lib.types.either functionToAspect (lib.types.functionTo providerType); 33 - providerType = lib.types.either functionProviderType aspectSubmodule; 34 35 aspectSubmoduleAttrs = lib.types.addCheck aspectSubmodule ( 36 m: (!builtins.isFunction m) || (isAspectSubmoduleFn m) ··· 78 options.provides = lib.mkOption { 79 description = "Providers of aspect for other aspects"; 80 default = { }; 81 - type = lib.types.submodule ( 82 - { config, ... }: 83 - { 84 - freeformType = lib.types.attrsOf providerType; 85 - config._module.args.provides = config; 86 - } 87 - ); 88 }; 89 options.__functor = lib.mkOption { 90 internal = true;
··· 5 aspectsType = lib.types.submodule ( 6 { config, ... }: 7 { 8 + freeformType = lib.types.attrsOf providerType; 9 config._module.args.aspects = config; 10 } 11 ); ··· 30 ); 31 32 functionProviderType = lib.types.either functionToAspect (lib.types.functionTo providerType); 33 + providerType = lib.types.either aspectSubmoduleAttrs functionProviderType; 34 35 aspectSubmoduleAttrs = lib.types.addCheck aspectSubmodule ( 36 m: (!builtins.isFunction m) || (isAspectSubmoduleFn m) ··· 78 options.provides = lib.mkOption { 79 description = "Providers of aspect for other aspects"; 80 default = { }; 81 + type = aspectsType; 82 }; 83 options.__functor = lib.mkOption { 84 internal = true;