Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ docs:
cd docs && pnpm run dev

ci test="":
nix-unit --override-input target . --flake github:vic/checkmate#.tests.systems.x86_64-linux.system-agnostic.{{test}}
nix-unit --override-input target . --flake github:denful/checkmate#.tests.systems.x86_64-linux.system-agnostic.{{test}}

check:
nix flake check --override-input target . github:vic/checkmate
nix flake check --override-input target . github:denful/checkmate

fmt:
nix run github:vic/checkmate#fmt --override-input target .
nix run github:denful/checkmate#fmt --override-input target .
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<!-- Badges -->

<p align="right">
<a href="https://dendritic.oeiuwq.com/sponsor"><img src="https://img.shields.io/badge/sponsor-vic-white?logo=githubsponsors&logoColor=white&labelColor=%23FF0000" alt="Sponsor Vic"/>
<a href="https://dendritic.oeiuwq.com/sponsor"><img src="https://img.shields.io/badge/sponsor-denful-white?logo=githubsponsors&logoColor=white&labelColor=%23FF0000" alt="Sponsor Vic"/>
</a>
<a href="https://dendritic.oeiuwq.com"> <img src="https://img.shields.io/badge/Dendritic-Nix-informational?logo=nixos&logoColor=white" alt="Dendritic Nix"/> </a>
<a href="https://github.com/vic/flake-aspects/actions">
<img src="https://github.com/vic/flake-aspects/actions/workflows/test.yml/badge.svg" alt="CI Status"/> </a>
<a href="LICENSE"> <img src="https://img.shields.io/github/license/vic/flake-aspects" alt="License"/> </a>
<a href="https://github.com/denful/flake-aspects/actions">
<img src="https://github.com/denful/flake-aspects/actions/workflows/test.yml/badge.svg" alt="CI Status"/> </a>
<a href="LICENSE"> <img src="https://img.shields.io/github/license/denful/flake-aspects" alt="License"/> </a>
</p>

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

> `flake-aspects` and [vic](https://bsky.app/profile/oeiuwq.bsky.social)'s [dendritic libs](https://dendritic.oeiuwq.com) made for you with Love++ and AI--. If you like my work, consider [sponsoring](https://dendritic.oeiuwq.com/sponsor)
> `flake-aspects` and [denful](https://bsky.app/profile/oeiuwq.bsky.social)'s [dendritic libs](https://dendritic.oeiuwq.com) made for you with Love++ and AI--. If you like my work, consider [sponsoring](https://dendritic.oeiuwq.com/sponsor)

In [aspect-oriented](https://den.oeiuwq.com) [Dendritic](https://github.com/mightyiam/dendritic) setups, it is common to expose modules using the structure `flake.modules.<class>.<aspect>`.

Expand Down
2 changes: 1 addition & 1 deletion checkmate/modules/tests/aspect_functor_merge.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# invoke all definitions and merge their results, causing duplication
# when the functor uses `self` (the merged aspect) to produce includes.
#
# See https://github.com/vic/den/issues/216
# See https://github.com/denful/den/issues/216
{ lib, new-scope, ... }:
{

Expand Down
2 changes: 1 addition & 1 deletion docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default defineConfig({
}),
],
editLink: {
baseUrl: 'https://github.com/vic/flake-aspects/edit/main/docs/',
baseUrl: 'https://github.com/denful/flake-aspects/edit/main/docs/',
},
customCss: [
'./src/styles/custom.css'
Expand Down
18 changes: 9 additions & 9 deletions docs/src/components/Ad.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@ import { LinkButton, Icon } from '@astrojs/starlight/components';
<div class="content">
<div class="header">
<Icon name="heart" size="2.5rem" class="heart-icon" />
<h4><code>vic/flake-aspects</code>?</h4>
<h4><code>denful/flake-aspects</code>?</h4>
</div>

<LinkButton href="https://dendritic.oeiuwq.com/sponsor" variant="primary">Become a Sponsor</LinkButton>

<p class="description">
flake-aspects is part of <a href="https://dendritic.oeiuwq.com">@vic's Dendritic Ecosystem</a> — made with love and maintained with passion.
flake-aspects is part of <a href="https://dendritic.oeiuwq.com">@denful's Dendritic Ecosystem</a> — made with love and maintained with passion.
</p>

<ul class="ecosystem">
<li><a href="https://github.com/vic/import-tree">import-tree</a></li>
<li><a href="https://github.com/vic/flake-file">flake-file</a></li>
<li><a href="https://github.com/vic/with-inputs">with-inputs</a></li>
<li><a href="https://github.com/vic/den">den</a></li>
<li><a href="https://github.com/vic/denful">denful</a></li>
<li><a href="https://github.com/vic/dendrix">dendrix</a></li>
<li><a href="https://github.com/denful/import-tree">import-tree</a></li>
<li><a href="https://github.com/denful/flake-file">flake-file</a></li>
<li><a href="https://github.com/denful/with-inputs">with-inputs</a></li>
<li><a href="https://github.com/denful/den">den</a></li>
<li><a href="https://github.com/denful/denful">denful</a></li>
<li><a href="https://github.com/denful/dendrix">dendrix</a></li>
</ul>

<LinkButton icon="github" href="https://github.com/vic?tab=repositories" variant="minimal"><code>More <strong>@vic</strong> OpenSource</code></LinkButton>
<LinkButton icon="github" href="https://github.com/denful?tab=repositories" variant="minimal"><code>More <strong>@denful</strong> OpenSource</code></LinkButton>
</div>
</section>

Expand Down
8 changes: 4 additions & 4 deletions docs/src/components/SocialIcons.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import Default from '@astrojs/starlight/components/SocialIcons.astro';

---

<a href="https://github.com/vic/flake-aspects/releases"><img src="https://img.shields.io/github/v/release/vic/flake-aspects?logo=github&color=white"/></a>
<a href="https://github.com/denful/flake-aspects/releases"><img src="https://img.shields.io/github/v/release/denful/flake-aspects?logo=github&color=white"/></a>

<a href="https://deepwiki.com/vic/flake-aspects"><img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki"></a>
<a href="https://deepwiki.com/denful/flake-aspects"><img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki"></a>

<a href="https://dendritic.oeiuwq.com"> <img src="https://img.shields.io/badge/@vic-Dendritic libs-informational?logo=nixos&logoColor=white" alt="Vic Dendritic Nix"/> </a>
<a href="https://dendritic.oeiuwq.com"> <img src="https://img.shields.io/badge/@denful-Dendritic libs-informational?logo=nixos&logoColor=white" alt="Vic Dendritic Nix"/> </a>

<a href="https://dendritic.oeiuwq.com/sponsor"><img src="https://img.shields.io/badge/Sponsor-@vic-white?logo=githubsponsors&logoColor=white" alt="Sponsor Den"/>
<a href="https://dendritic.oeiuwq.com/sponsor"><img src="https://img.shields.io/badge/Sponsor-@denful-white?logo=githubsponsors&logoColor=white" alt="Sponsor Den"/>
</a>

<Default />
8 changes: 4 additions & 4 deletions docs/src/content/docs/concepts/aspects.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Aside } from '@astrojs/starlight/components';

## Aspect structure

Each aspect is a Nix submodule ([`nix/types.nix`](https://github.com/vic/flake-aspects/blob/main/nix/types.nix)) with:
Each aspect is a Nix submodule ([`nix/types.nix`](https://github.com/denful/flake-aspects/blob/main/nix/types.nix)) with:

| Attribute | Type | Purpose |
|---|---|---|
Expand Down Expand Up @@ -37,7 +37,7 @@ Each key under the aspect that is not a reserved attribute (`name`, `description

## Resolution

Source: [`nix/resolve.nix`](https://github.com/vic/flake-aspects/blob/main/nix/resolve.nix)
Source: [`nix/resolve.nix`](https://github.com/denful/flake-aspects/blob/main/nix/resolve.nix)

```
resolve : class → aspect-chain → provided → { imports }
Expand Down Expand Up @@ -77,8 +77,8 @@ provides.logging = { aspect-chain, class }:
```

<Aside>
Tests: [`aspect_chain.nix`](https://github.com/vic/flake-aspects/blob/main/checkmate/modules/tests/aspect_chain.nix) ·
[`aspect_modules_resolved.nix`](https://github.com/vic/flake-aspects/blob/main/checkmate/modules/tests/aspect_modules_resolved.nix)
Tests: [`aspect_chain.nix`](https://github.com/denful/flake-aspects/blob/main/checkmate/modules/tests/aspect_chain.nix) ·
[`aspect_modules_resolved.nix`](https://github.com/denful/flake-aspects/blob/main/checkmate/modules/tests/aspect_modules_resolved.nix)
</Aside>

## Accessing resolved modules
Expand Down
8 changes: 4 additions & 4 deletions docs/src/content/docs/concepts/providers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ provides.logging = { class, aspect-chain }: {
```

<Aside>
Test: [`aspect_provides.nix`](https://github.com/vic/flake-aspects/blob/main/checkmate/modules/tests/aspect_provides.nix)
Test: [`aspect_provides.nix`](https://github.com/denful/flake-aspects/blob/main/checkmate/modules/tests/aspect_provides.nix)
</Aside>

## Fixpoint semantics
Expand All @@ -60,15 +60,15 @@ flake.aspects = { aspects, ... }: {
};
```

The fixpoint is implemented via `freeformType` with `_module.args.aspects = config` in [types.nix](https://github.com/vic/flake-aspects/blob/main/nix/types.nix), so `aspects` always refers to the evaluated sibling scope.
The fixpoint is implemented via `freeformType` with `_module.args.aspects = config` in [types.nix](https://github.com/denful/flake-aspects/blob/main/nix/types.nix), so `aspects` always refers to the evaluated sibling scope.

<Aside>
Test: [`aspect_fixpoint.nix`](https://github.com/vic/flake-aspects/blob/main/checkmate/modules/tests/aspect_fixpoint.nix) — resolves aspects from five levels: top-level `aspects.five`, provider-local `aspects.four`, and cross-scope `aspects.two._.sub`.
Test: [`aspect_fixpoint.nix`](https://github.com/denful/flake-aspects/blob/main/checkmate/modules/tests/aspect_fixpoint.nix) — resolves aspects from five levels: top-level `aspects.five`, provider-local `aspects.four`, and cross-scope `aspects.two._.sub`.
</Aside>

## Provider types

The type system ([`nix/types.nix`](https://github.com/vic/flake-aspects/blob/main/nix/types.nix)) accepts several provider shapes:
The type system ([`nix/types.nix`](https://github.com/denful/flake-aspects/blob/main/nix/types.nix)) accepts several provider shapes:

| Shape | Description |
|---|---|
Expand Down
10 changes: 5 additions & 5 deletions docs/src/content/docs/concepts/transpose.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ transpose { a.x = 1; b.x = 2; }
```

<Aside>
Tests: [`transpose_swap.nix`](https://github.com/vic/flake-aspects/blob/main/checkmate/modules/tests/transpose_swap.nix) ·
[`transpose_common.nix`](https://github.com/vic/flake-aspects/blob/main/checkmate/modules/tests/transpose_common.nix)
Tests: [`transpose_swap.nix`](https://github.com/denful/flake-aspects/blob/main/checkmate/modules/tests/transpose_swap.nix) ·
[`transpose_common.nix`](https://github.com/denful/flake-aspects/blob/main/checkmate/modules/tests/transpose_common.nix)
</Aside>

## Source: [`nix/default.nix`](https://github.com/vic/flake-aspects/blob/main/nix/default.nix)
## Source: [`nix/default.nix`](https://github.com/denful/flake-aspects/blob/main/nix/default.nix)

The implementation is a three-phase pipeline:

Expand All @@ -47,7 +47,7 @@ You can use `emit` to:

## How aspects exploit `emit`

[`nix/aspects.nix`](https://github.com/vic/flake-aspects/blob/main/nix/aspects.nix) supplies a custom `emit` that calls [`resolve`](/concepts/aspects/#resolution) on each item:
[`nix/aspects.nix`](https://github.com/denful/flake-aspects/blob/main/nix/aspects.nix) supplies a custom `emit` that calls [`resolve`](/concepts/aspects/#resolution) on each item:

```nix
emit = transposed: [{
Expand All @@ -61,5 +61,5 @@ emit = transposed: [{
This intercepts every `<aspect>.<class>` → `<class>.<aspect>` transposition and replaces the raw value with a fully-resolved module that includes all transitive dependencies.

<Aside>
Test: [`tranpose_flake_modules.nix`](https://github.com/vic/flake-aspects/blob/main/checkmate/modules/tests/tranpose_flake_modules.nix)
Test: [`tranpose_flake_modules.nix`](https://github.com/denful/flake-aspects/blob/main/checkmate/modules/tests/tranpose_flake_modules.nix)
</Aside>
8 changes: 4 additions & 4 deletions docs/src/content/docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ All contributions welcome. PRs are checked by CI.
## Run tests

```shell
nix flake check github:vic/checkmate --override-input target . -L
nix flake check github:denful/checkmate --override-input target . -L
```

## Format code

```shell
nix run github:vic/checkmate#fmt --override-input target .
nix run github:denful/checkmate#fmt --override-input target .
```

## Bug reports
Expand All @@ -33,5 +33,5 @@ cd docs && pnpm install && pnpm run dev

## Community

- [GitHub Issues](https://github.com/vic/flake-aspects/issues) — bugs and features
- [GitHub Discussions](https://github.com/vic/flake-aspects/discussions) — questions and ideas
- [GitHub Issues](https://github.com/denful/flake-aspects/issues) — bugs and features
- [GitHub Discussions](https://github.com/denful/flake-aspects/discussions) — questions and ideas
4 changes: 2 additions & 2 deletions docs/src/content/docs/guides/dependencies.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ When `server` is resolved for class `"nixos"`, the result is:
Only classes **present on the included aspect** propagate. If `networking` has no `darwin` key, nothing from `networking` appears when resolving for `"darwin"`.

<Aside>
Test: [`aspect_dependencies.nix`](https://github.com/vic/flake-aspects/blob/main/checkmate/modules/tests/aspect_dependencies.nix)
Test: [`aspect_dependencies.nix`](https://github.com/denful/flake-aspects/blob/main/checkmate/modules/tests/aspect_dependencies.nix)
</Aside>

## Transitive resolution
Expand All @@ -62,7 +62,7 @@ flake.aspects = { aspects, ... }: {
Resolving `one` for `classOne` collects `["1", "2", "3", "4"]`.

<Aside>
Test: [`aspect_fixpoint.nix`](https://github.com/vic/flake-aspects/blob/main/checkmate/modules/tests/aspect_fixpoint.nix) — tests five-level transitive resolution.
Test: [`aspect_fixpoint.nix`](https://github.com/denful/flake-aspects/blob/main/checkmate/modules/tests/aspect_fixpoint.nix) — tests five-level transitive resolution.
</Aside>

## Inline aspects as includes
Expand Down
8 changes: 4 additions & 4 deletions docs/src/content/docs/guides/flake-parts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Add `flake-aspects` to your flake inputs and import its `flakeModule`:

```nix
{
inputs.flake-aspects.url = "github:vic/flake-aspects";
inputs.flake-aspects.url = "github:denful/flake-aspects";

outputs = { flake-parts, flake-aspects, nixpkgs, ... }@inputs:
flake-parts.lib.mkFlake { inherit inputs; } {
Expand All @@ -38,7 +38,7 @@ Add `flake-aspects` to your flake inputs and import its `flakeModule`:

## How it works

The [`flakeModule`](https://github.com/vic/flake-aspects/blob/main/nix/flakeModule.nix) calls [`new`](/reference/api/#new) with a callback that:
The [`flakeModule`](https://github.com/denful/flake-aspects/blob/main/nix/flakeModule.nix) calls [`new`](/reference/api/#new) with a callback that:

1. Creates `flake.aspects` as a user-facing option (type: `aspectsType`).
2. Sets `flake.modules` to the transposed + resolved output.
Expand All @@ -59,8 +59,8 @@ imports = [
Then in your system configs: `inputs.self.modules.nixos.my-desktop`.

<Aside>
Test: [`tranpose_flake_modules.nix`](https://github.com/vic/flake-aspects/blob/main/checkmate/modules/tests/tranpose_flake_modules.nix) ·
[`default_empty.nix`](https://github.com/vic/flake-aspects/blob/main/checkmate/modules/tests/default_empty.nix)
Test: [`tranpose_flake_modules.nix`](https://github.com/denful/flake-aspects/blob/main/checkmate/modules/tests/tranpose_flake_modules.nix) ·
[`default_empty.nix`](https://github.com/denful/flake-aspects/blob/main/checkmate/modules/tests/default_empty.nix)
</Aside>

## Using dependencies
Expand Down
6 changes: 3 additions & 3 deletions docs/src/content/docs/guides/forward.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Aside } from '@astrojs/starlight/components';

## What `forward` does

[`forward`](https://github.com/vic/flake-aspects/blob/main/nix/forward.nix) resolves an aspect for one class and injects the result into a submodule path of another class. This enables cross-class configuration routing.
[`forward`](https://github.com/denful/flake-aspects/blob/main/nix/forward.nix) resolves an aspect for one class and injects the result into a submodule path of another class. This enables cross-class configuration routing.

The canonical use case: forward `homeManager` modules into `nixos.home-manager.users.<name>`.

Expand Down Expand Up @@ -65,12 +65,12 @@ flake.aspects = { aspects, ... }: {
Resolving for `"targetClass"` merges `["from-target", "from-source"]`.

<Aside>
Test: [`forward.nix`](https://github.com/vic/flake-aspects/blob/main/checkmate/modules/tests/forward.nix)
Test: [`forward.nix`](https://github.com/denful/flake-aspects/blob/main/checkmate/modules/tests/forward.nix)
</Aside>

## Real-world: Home-Manager into NixOS

This is how [Den](https://github.com/vic/den) forwards user home-manager configs into host NixOS:
This is how [Den](https://github.com/denful/den) forwards user home-manager configs into host NixOS:

```nix
hmSupport = { host }: forward {
Expand Down
4 changes: 2 additions & 2 deletions docs/src/content/docs/guides/functor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ When resolved for `"nixos"`, it returns the full aspect (with `nixos.base = true
When resolved for `"darwin"`, it returns a different aspect with `darwin.fallback = true`.

<Aside>
Test: [`aspect_default_provider_functor.nix`](https://github.com/vic/flake-aspects/blob/main/checkmate/modules/tests/aspect_default_provider_functor.nix)
Test: [`aspect_default_provider_functor.nix`](https://github.com/denful/flake-aspects/blob/main/checkmate/modules/tests/aspect_default_provider_functor.nix)
</Aside>

## Functor with parametric includes
Expand Down Expand Up @@ -63,5 +63,5 @@ Note: when `__functor` is overridden, the aspect's own class configs (e.g., `cla
are **not** automatically included — the functor's return value replaces the aspect entirely during resolution.

<Aside>
Test: [`aspect_default_provider_override.nix`](https://github.com/vic/flake-aspects/blob/main/checkmate/modules/tests/aspect_default_provider_override.nix) — demonstrates that functor return replaces the original aspect config.
Test: [`aspect_default_provider_override.nix`](https://github.com/denful/flake-aspects/blob/main/checkmate/modules/tests/aspect_default_provider_override.nix) — demonstrates that functor return replaces the original aspect config.
</Aside>
6 changes: 3 additions & 3 deletions docs/src/content/docs/guides/parametric.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ flake.aspects = { aspects, ... }: {
Resolving `server` for `"nixos"` produces imports containing `{ users.users.bob.isNormalUser = true; }`.

<Aside>
Test: [`aspect_parametric.nix`](https://github.com/vic/flake-aspects/blob/main/checkmate/modules/tests/aspect_parametric.nix)
Test: [`aspect_parametric.nix`](https://github.com/denful/flake-aspects/blob/main/checkmate/modules/tests/aspect_parametric.nix)
</Aside>

## Top-level parametric
Expand All @@ -43,14 +43,14 @@ flake.aspects = { aspects, ... }: {
};
```

The type system ([`nix/types.nix`](https://github.com/vic/flake-aspects/blob/main/nix/types.nix)) distinguishes between:
The type system ([`nix/types.nix`](https://github.com/denful/flake-aspects/blob/main/nix/types.nix)) distinguishes between:
- **Direct providers**: `{ class, aspect-chain } → aspect` (1-2 named args: `class` and/or `aspect-chain`)
- **Curried providers**: `anything → provider` (other function signatures)

A curried provider is invoked by the user at inclusion time. Its return value must be either another provider function or a direct aspect attrset.

<Aside>
Test: [`aspect_toplevel_parametric.nix`](https://github.com/vic/flake-aspects/blob/main/checkmate/modules/tests/aspect_toplevel_parametric.nix)
Test: [`aspect_toplevel_parametric.nix`](https://github.com/denful/flake-aspects/blob/main/checkmate/modules/tests/aspect_toplevel_parametric.nix)
</Aside>

## Combining with context
Expand Down
Loading