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
MDX 45.5%
Nix 32.2%
Astro 19.4%
JavaScript 2.6%
TypeScript 0.3%
CSS 0.1%
80 3 4

Clone this repository

https://tangled.org/oeiuwq.com/flake-aspects https://tangled.org/did:plc:hwcqoy35x55nzde2sm6dbvq7/flake-aspects
git@tangled.org:oeiuwq.com/flake-aspects git@tangled.org:did:plc:hwcqoy35x55nzde2sm6dbvq7/flake-aspects

For self-hosted knots, clone URLs may differ based on your setup.

Download tar.gz
README.md

Sponsor Vic Dendritic Nix CI Status License

<aspect>.<class> Transposition for Dendritic Nix#

flake-aspects and vic's dendritic libs made for you with Love++ and AI--. If you like my work, consider sponsoring

In aspect-oriented Dendritic setups, it is common to expose modules using the structure flake.modules.<class>.<aspect>.

However, for many users, a transposed attribute set, <aspect>.<class>, can be more intuitive. It often feels more natural to nest classes within aspects rather than the other way around.

This project provides a small, dependency-free transpose primitive that is powerful enough to implement cross-aspect dependencies for any Nix configuration class. It also includes a flake-parts module that transforms flake.aspects into flake.modules.

flake.aspects
{
  vim-btw = {
    nixos = ...;
    darwin = ...;
    homeManager = ...;
    nixvim = ...;
  };
  tiling-desktop = {
    nixos = ...;
    darwin = ...;
  };
  macos-develop = {
    darwin = ...;
    hjem = ...;
  };
}
image flake.modules
{
  nixos = {
    vim-btw = ...;
    tiling-desktop = ...;
  };
  darwin = {
    vim-btw = ...;
    tiling-desktop = ...;
    macos-develop = ...;
  };
  homeManager = {
    vim-btw = ...;
  };
  hjem = {
    macos-develop = ...;
  };
  nixvim = {
    vim-btw = ...;
  };
}

Unlike flake.modules.<class>.<aspect> which is flat, aspects form a tree via provides (alias: _) and a graph via includes.


Quick Start#

# flake.nix
{
  inputs.flake-aspects.url = "github:vic/flake-aspects";
  outputs = { flake-parts, flake-aspects, nixpkgs, ... }@inputs:
    flake-parts.lib.mkFlake { inherit inputs; } {
      imports = [ flake-aspects.flakeModule ];
      flake.aspects = { aspects, ... }: {
        my-desktop = {
          nixos  = { };
          darwin = { };
          includes = [ aspects.my-tools ];
        };
        my-tools.nixos = { };
      };
    };
}

Also works without flakes via new-scope and lib.evalModules.

Documentation#

Full documentation

Section Content
Concepts Transpose, resolution algorithm, providers & fixpoint
Guides flake-parts, standalone, dependencies, parametric, functor, forward
Reference API exports, type system, test suite

Testing#

nix run github:vic/checkmate#fmt --override-input target .
nix flake check github:vic/checkmate --override-input target . -L