cherry-pickable Dendritic modules to extend your config easily. like a lazyvim-distribution but for dendritic nix. Discussions: https://oeiuwq.zulipchat.com/join/nqp26cd4kngon6mo3ncgnuap/ dendrix.oeiuwq.com/Dendritic.html
reusable dedritic nix modules configuration distribution

tangled

+123 -11
-11
.github/workflows/tangled.yaml
··· 1 - on: 2 - workflow_dispatch: 3 - push: 4 - concurrency: 5 - group: tangled 6 - cancel-in-progress: true 7 - jobs: 8 - tangled: 9 - uses: vic/vic/.github/workflows/tangled.yml@main 10 - secrets: 11 - TANGLED_SSH_KEY: ${{secrets.TANGLED_SSH_KEY}}
+12
.tangled/workflows/mirror.yml
··· 1 + when: 2 + - event: ["push"] 3 + branch: ["*"] 4 + engine: "nixery" 5 + clone: 6 + skip: true 7 + dependencies: 8 + nixpkgs: 9 + - gh 10 + steps: 11 + - name: mirror 12 + command: gh -R vic/vic issue comment 3 -b denful
+1
flake.nix
··· 1 1 { 2 2 outputs = _: { 3 + flakeModule = ./flakeModule.nix; 3 4 }; 4 5 }
+7
flakeModule.nix
··· 1 + { inputs, lib, config, ... }: 2 + let 3 + mainModule = { imports = [ (inputs.import-tree ./modules) ]; }; 4 + denful = lib.evalModules { modules = [ mainModule ]; }; 5 + in { 6 + imports = [ mainModule ]; 7 + }
+21
modules/_tmp/nixos/_facet.nix
··· 1 + { inputs, lib, ... }: 2 + name: 3 + let 4 + inherit (inputs.flake-aspects.lib lib) new-scope; 5 + mkFacet = 6 + name: 7 + { config, ... }: 8 + { 9 + _module.args.denful.${name} = config.${name}.aspects; 10 + imports = [ (new-scope name) ]; 11 + flake.modules.flake.${name} = { 12 + _module.args.denful.${name} = config.${name}.aspects; 13 + imports = [ (config.${name}.modules.flake.denful or { }) ]; 14 + }; 15 + }; 16 + in 17 + { 18 + 19 + _module.args.denful.foo = { }; 20 + 21 + }
+3
modules/_tmp/nixos/base.nix
··· 1 + { 2 + 3 + }
+47
modules/_tmp/nixos/hosts-class.nix
··· 1 + { inputs, ... }: 2 + { 3 + vix.aspects.denful = { 4 + flake = { }; 5 + }; 6 + 7 + vix.aspects.import-tree.provides.hosts = { 8 + description = '' 9 + ### Automatic import of host's nixos/darwin modules. 10 + 11 + #### Usage Examples 12 + 13 + # modules/hosts/default.nix 14 + { denful, ... }: 15 + { 16 + imports = [ denful.vix.facet ]; 17 + } 18 + 19 + #### Arguments 20 + 21 + hostPath: A path. 22 + 23 + #### Aspect behaviour 24 + 25 + this aspect hooks into `den.aspects.default.host` and 26 + for each host, it will import-tree all nix files: 27 + 28 + ''${hostsPath}/''${host.name}/_''${host.class}/**/*.nix 29 + 30 + each nix file is part of the corresponding class: nixos/darwin. 31 + ''; 32 + 33 + __functor = 34 + _: 35 + { hostsPath }: 36 + { host }: 37 + let 38 + path = "${hostsPath}/${host.name}/_${host.class}"; 39 + imported = { 40 + name = path; 41 + description = "import-tree ${path}"; 42 + ${host.class}.imports = [ (inputs.import-tree path) ]; 43 + }; 44 + in 45 + if builtins.pathExists path then imported else { }; 46 + }; 47 + }
+6
modules/den/unfree.nix
··· 1 + { 2 + 3 + 4 + 5 + 6 + }
+13
modules/lib.nix
··· 1 + { lib, ... }: 2 + let 3 + denful-lib = { 4 + dup = x : x * 2; 5 + }; 6 + in 7 + { 8 + config.denful.lib = denful-lib; 9 + options.denful.lib = lib.mkOption { 10 + type = lib.types.attrsOf lib.types.unspecified; 11 + default = {}; 12 + }; 13 + }
+13
modules/options.nix
··· 1 + { lib, config, ... }: 2 + let 3 + denfulType = lib.types.submodule({ name, ... }: { 4 + freeformType = lib.types.attrsOf denfulType; 5 + }); 6 + in 7 + { 8 + options.denful = lib.mkOption { 9 + type = denfulType; 10 + default = {}; 11 + }; 12 + config._module.args.denful = config.denful; 13 + }