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
16 changes: 8 additions & 8 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-file/actions">
<img src="https://github.com/vic/flake-file/workflows/flake-check/badge.svg" alt="CI Status"/> </a>
<a href="LICENSE"> <img src="https://img.shields.io/github/license/vic/flake-file" alt="License"/> </a>
<a href="https://github.com/denful/flake-file/actions">
<img src="https://github.com/denful/flake-file/workflows/flake-check/badge.svg" alt="CI Status"/> </a>
<a href="LICENSE"> <img src="https://img.shields.io/github/license/denful/flake-file" alt="License"/> </a>
</p>

# Non-static Nix on your flake inputs! Define custom output schemas.

> `flake-file` 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-file` 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)

**flake-file** lets you generate a clean, maintainable `flake.nix` from Nix module options. Use the _real_ Nix language to define your inputs.

Expand All @@ -30,15 +30,15 @@ This means
### Features

- Flake definition aggregated from Nix modules.
- [Input](https://github.com/vic/flake-file/blob/main/modules/options/default.nix) and Output schemas based on Nix types.
- [Input](https://github.com/denful/flake-file/blob/main/modules/options/default.nix) and Output schemas based on Nix types.
- Syntax for nixConfig and follows is the same as in flakes.
- `flake check` ensures files are up to date.
- App for `flake.nix` generator: `nix run .#write-flake`
- Custom do-not-edit header.
- Automatic flake.lock [flattening](#automatic-flakelock-flattening).
- Incrementally add [flake-parts-builder](#parts_templates) templates.
- Pick flakeModules for different feature sets.
- [Dendritic](https://vic.github.io/dendrix/Dendritic.html) flake template.
- [Dendritic](https://denful.github.io/dendrix/Dendritic.html) flake template.
- Works on stable Nix, [npins](templates/npins), [unflake](templates/unflake), [nixlock](templates/nixlock) environments.

</td><td>
Expand All @@ -55,5 +55,5 @@ This means

```shell
mv flake.nix flake-file.nix
nix-shell https://github.com/vic/flake-file/archive/main.zip -A flake-file.sh --run bootstrap
nix-shell https://github.com/denful/flake-file/archive/main.zip -A flake-file.sh --run bootstrap
```
32 changes: 16 additions & 16 deletions dev/_bootstrap-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,29 @@ let
);

empty = bootstrap {
inputs.empty.url = "github:vic/empty-flake";
inputs.empty.url = "github:denful/empty-flake";
outputs = _: { };
};

all-inputs-schemes = bootstrap {
inputs.simple.url = "github:vic/empty-flake";
inputs.withBranch.url = "github:vic/empty-flake/main";
inputs.simple.url = "github:denful/empty-flake";
inputs.withBranch.url = "github:denful/empty-flake/main";
inputs.noflake = {
url = "github:vic/empty-flake/main";
url = "github:denful/empty-flake/main";
flake = false;
};
inputs.gitHttps.url = "git+https://github.com/vic/empty-flake";
inputs.tarball.url = "https://github.com/vic/empty-flake/archive/main.tar.gz";
inputs.tarballPlus.url = "tarball+https://github.com/vic/empty-flake/archive/main.tar.gz";
inputs.fileHttps.url = "file+https://github.com/vic/empty-flake/archive/main.tar.gz";
inputs.gitHttps.url = "git+https://github.com/denful/empty-flake";
inputs.tarball.url = "https://github.com/denful/empty-flake/archive/main.tar.gz";
inputs.tarballPlus.url = "tarball+https://github.com/denful/empty-flake/archive/main.tar.gz";
inputs.fileHttps.url = "file+https://github.com/denful/empty-flake/archive/main.tar.gz";
inputs.attrGh = {
type = "github";
owner = "vic";
owner = "denful";
repo = "empty-flake";
};
inputs.attrGhRef = {
type = "github";
owner = "vic";
owner = "denful";
repo = "empty-flake";
ref = "main";
};
Expand All @@ -49,7 +49,7 @@ let
};

flake-parts-follows = bootstrap {
inputs.nixpkgs-lib.url = "github:vic/empty-flake";
inputs.nixpkgs-lib.url = "github:denful/empty-flake";
inputs.flake-parts.url = "github:hercules-ci/flake-parts";
inputs.flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs-lib";
};
Expand All @@ -67,7 +67,7 @@ let
text = ''
write-inputs
cat ${outdir}/inputs.nix
grep github:vic/empty-flake ${outdir}/inputs.nix
grep github:denful/empty-flake ${outdir}/inputs.nix
'';
};

Expand All @@ -80,7 +80,7 @@ let
text = ''
write-flake
cat ${outdir}/flake.nix
grep github:vic/empty-flake ${outdir}/flake.nix
grep github:denful/empty-flake ${outdir}/flake.nix
'';
};

Expand Down Expand Up @@ -121,7 +121,7 @@ let
write-npins
cat ${outdir}/npins/sources.json
jq -e '.pins."flake-parts".url | contains("hercules-ci/flake-parts")' ${outdir}/npins/sources.json
jq -e '.pins."nixpkgs-lib".url | contains("vic/empty")' ${outdir}/npins/sources.json
jq -e '.pins."nixpkgs-lib".url | contains("denful/empty")' ${outdir}/npins/sources.json
'';
};

Expand Down Expand Up @@ -218,7 +218,7 @@ let
echo "{ }" > ${outdir}/flake.lock
write-lock
[ -e ${outdir}/flake.nix ]
grep github:vic/empty-flake ${outdir}/flake.nix
grep github:denful/empty-flake ${outdir}/flake.nix
'';
};

Expand Down Expand Up @@ -278,7 +278,7 @@ let
grep '"attrGh"' ${outdir}/nixlock.lock.nix
grep '"attrGhRef"' ${outdir}/nixlock.lock.nix
if grep '"followsSimple"' ${outdir}/nixlock.lock.nix; then exit 1; fi
grep vic/empty-flake ${outdir}/nixlock.lock.nix
grep denful/empty-flake ${outdir}/nixlock.lock.nix
'';
};

Expand Down
4 changes: 2 additions & 2 deletions dev/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dev/flake.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# DO-NOT-EDIT. This file was auto-generated using github:vic/flake-file.
# DO-NOT-EDIT. This file was auto-generated using github:denful/flake-file.
# Use `nix run .#write-flake` to regenerate it.
{
outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./modules);
Expand All @@ -13,7 +13,7 @@
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
import-tree.url = "github:vic/import-tree";
import-tree.url = "github:denful/import-tree";
nix-auto-follow = {
url = "github:fzakaria/nix-auto-follow";
inputs.nixpkgs.follows = "nixpkgs";
Expand Down
2 changes: 1 addition & 1 deletion docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default defineConfig({
}),
],
editLink: {
baseUrl: "https://github.com/vic/flake-file/edit/main/docs/",
baseUrl: "https://github.com/denful/flake-file/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-file</code>?</h4>
<h4><code>denful/flake-file</code>?</h4>
</div>

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

<p class="description">
flake-file is part of <a href="https://dendritic.oeiuwq.com">@vic's Dendritic Ecosystem</a> — made with love and maintained with passion.
flake-file 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-aspects">flake-aspects</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-aspects">flake-aspects</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
2 changes: 1 addition & 1 deletion docs/src/components/FooterLinks.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Icon } from '@astrojs/starlight/components';
---

<section class="sl-flex">
<a href="https://github.com/vic/flake-file" class="sl-flex">
<a href="https://github.com/denful/flake-file" class="sl-flex">
<Icon name="rocket" size="1.2em" />
Contribute
</a>
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-file/releases"><img src="https://img.shields.io/github/v/release/vic/flake-file?logo=github&color=white"/></a>
<a href="https://github.com/denful/flake-file/releases"><img src="https://img.shields.io/github/v/release/denful/flake-file?logo=github&color=white"/></a>

<a href="https://deepwiki.com/vic/flake-file"><img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki"></a>
<a href="https://deepwiki.com/denful/flake-file"><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 Libs"/> </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 Libs"/> </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 />
2 changes: 1 addition & 1 deletion docs/src/content/docs/explanation/what-is-flake-file.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ Many Dendritic Nix layouts use flake-file because it helps with localization of
Inputs are declared near where they are used, frequently in the same module.
Decomissining the module also removes the inputs.

Even when flake-file was born for flakes, its author [vic/vix](https://github.com/vic/vix) uses flake-file without flakes. The [`dev/`](https://github.com/vic/flake-file/blob/main/dev) directory in this repo eats its own cooking. [More examples on GitHub](https://github.com/search?q=%22vic%2Fflake-file%22+language%3ANix&type=code).
Even when flake-file was born for flakes, its author [denful/vix](https://github.com/denful/vix) uses flake-file without flakes. The [`dev/`](https://github.com/denful/flake-file/blob/main/dev) directory in this repo eats its own cooking. [More examples on GitHub](https://github.com/search?q=%22vic%2Fflake-file%22+language%3ANix&type=code).
22 changes: 11 additions & 11 deletions docs/src/content/docs/guides/flake-modules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ The base module. Provides all `flake-file.*` options, the `write-flake` app, and
}
```

Source: [`modules/default.nix`](https://github.com/vic/flake-file/tree/main/modules/default.nix)
Source: [`modules/default.nix`](https://github.com/denful/flake-file/tree/main/modules/default.nix)

## `flakeModules.import-tree`

Adds [import-tree](https://github.com/vic/import-tree) — auto-import all `.nix` files from a directory.
Adds [import-tree](https://github.com/denful/import-tree) — auto-import all `.nix` files from a directory.

Source: [`modules/import-tree.nix`](https://github.com/vic/flake-file/tree/main/modules/import-tree.nix)
Source: [`modules/import-tree.nix`](https://github.com/denful/flake-file/tree/main/modules/import-tree.nix)

## `flakeModules.dendritic`

A batteries-included setup for [Dendritic](https://vic.github.io/dendrix/Dendritic.html) projects. Includes:
A batteries-included setup for [Dendritic](https://denful.github.io/dendrix/Dendritic.html) projects. Includes:

- `flakeModules.default`
- `flakeModules.import-tree`
Expand All @@ -44,7 +44,7 @@ A batteries-included setup for [Dendritic](https://vic.github.io/dendrix/Dendrit
}
```

Source: [`modules/dendritic/default.nix`](https://github.com/vic/flake-file/tree/main/modules/dendritic/default.nix)
Source: [`modules/dendritic/default.nix`](https://github.com/denful/flake-file/tree/main/modules/dendritic/default.nix)

## `lib.flakeModules.flake-parts-builder`

Expand All @@ -60,34 +60,34 @@ Integrates [flake-parts-builder](https://github.com/tsandrini/flake-parts-builde

See [flake-parts-builder guide](/guides/flake-parts-builder) for details.

Source: [`modules/flake-parts-builder/default.nix`](https://github.com/vic/flake-file/tree/main/modules/flake-parts-builder/default.nix)
Source: [`modules/flake-parts-builder/default.nix`](https://github.com/denful/flake-file/tree/main/modules/flake-parts-builder/default.nix)

## `flakeModules.allfollow`

Enables automatic `flake.lock` flattening using [spikespaz/allfollow](https://github.com/spikespaz/allfollow).

Source: [`modules/prune-lock/allfollow.nix`](https://github.com/vic/flake-file/tree/main/modules/prune-lock/allfollow.nix)
Source: [`modules/prune-lock/allfollow.nix`](https://github.com/denful/flake-file/tree/main/modules/prune-lock/allfollow.nix)

## `flakeModules.nix-auto-follow`

Enables automatic `flake.lock` flattening using [fzakaria/nix-auto-follow](https://github.com/fzakaria/nix-auto-follow).

Source: [`modules/prune-lock/nix-auto-follow.nix`](https://github.com/vic/flake-file/tree/main/modules/prune-lock/nix-auto-follow.nix)
Source: [`modules/prune-lock/nix-auto-follow.nix`](https://github.com/denful/flake-file/tree/main/modules/prune-lock/nix-auto-follow.nix)

## `flakeModules.npins`

Defines `flake-file` options for [npins](https://github.com/andir/npins)-based environments. Exposes `write-npins`. Supports `github`, `gitlab`, `channel`, `tarball`, and `git` schemes. Respects `follows` for deduplication. Prunes stale pins automatically.

Source: [`modules/npins`](https://github.com/vic/flake-file/tree/main/modules/npins)
Source: [`modules/npins`](https://github.com/denful/flake-file/tree/main/modules/npins)

## `flakeModules.unflake`

Defines `flake-file` options for [unflake](https://codeberg.org/goldstein/unflake)-based environments. Exposes `write-unflake`.

Source: [`modules/unflake`](https://github.com/vic/flake-file/tree/main/modules/unflake)
Source: [`modules/unflake`](https://github.com/denful/flake-file/tree/main/modules/unflake)

## `flakeModules.nixlock`

Defines `flake-file` options for [nixlock](https://codeberg.org/FrdrCkII/nixlock)-based environments. Exposes `write-nixlock`.

Source: [`modules/nixlock`](https://github.com/vic/flake-file/tree/main/modules/nixlock)
Source: [`modules/nixlock`](https://github.com/denful/flake-file/tree/main/modules/nixlock)
4 changes: 2 additions & 2 deletions docs/src/content/docs/guides/flake-parts-builder.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ This:
## Adding parts

```shell
nix run github:vic/flake-parts-builder/write-meta -- add --write-meta --parts systems,treefmt $PWD
nix run github:denful/flake-parts-builder/write-meta -- add --write-meta --parts systems,treefmt $PWD
```

> **Important:** Use `github:vic/flake-parts-builder/write-meta` until [flake-parts-builder#60](https://github.com/tsandrini/flake-parts-builder/pull/60) is merged. This branch writes each part's `_meta/` file so that flake-file can manage inputs declared by the part.
> **Important:** Use `github:denful/flake-parts-builder/write-meta` until [flake-parts-builder#60](https://github.com/tsandrini/flake-parts-builder/pull/60) is merged. This branch writes each part's `_meta/` file so that flake-file can manage inputs declared by the part.

> **Warning:** Only use the `add` subcommand. The `init` subcommand overwrites `flake.nix`, which is managed by flake-file.

Expand Down
4 changes: 2 additions & 2 deletions docs/src/content/docs/guides/lock-flattening.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ flake-file ships support for two established flattening tools:
}
```

Source: [`modules/prune-lock/allfollow.nix`](https://github.com/vic/flake-file/tree/main/modules/prune-lock/allfollow.nix)
Source: [`modules/prune-lock/allfollow.nix`](https://github.com/denful/flake-file/tree/main/modules/prune-lock/allfollow.nix)

### nix-auto-follow

Expand All @@ -33,7 +33,7 @@ Source: [`modules/prune-lock/allfollow.nix`](https://github.com/vic/flake-file/t
}
```

Source: [`modules/prune-lock/nix-auto-follow.nix`](https://github.com/vic/flake-file/tree/main/modules/prune-lock/nix-auto-follow.nix)
Source: [`modules/prune-lock/nix-auto-follow.nix`](https://github.com/denful/flake-file/tree/main/modules/prune-lock/nix-auto-follow.nix)

## How it integrates

Expand Down
Loading
Loading