Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/flake-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
name: Bootstrap templates/minimal
runs-on: ubuntu-latest
env:
NIX_PATH: "nixpkgs=https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz"
NIX_PATH: "nixpkgs=https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.zst"
steps:
- uses: wimpysworld/nothing-but-nix@v10
- uses: cachix/install-nix-action@v31
Expand All @@ -41,7 +41,7 @@ jobs:
name: Bootstrap apps
runs-on: ubuntu-latest
env:
NIX_PATH: "nixpkgs=https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz"
NIX_PATH: "nixpkgs=https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.zst"
# write-tack resolves refs via api.github.com; anonymous rate limits flake on shared runners
GITHUB_TOKEN: ${{ github.token }}
steps:
Expand Down
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
<!-- 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://denful.dev/sponsor"><img src="https://img.shields.io/badge/sponsor-vic-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://denful.dev/"> <img src="https://img.shields.io/badge/Dendritic-Nix-informational?logo=nixos&logoColor=white" alt="Dendritic Nix"/> </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)
> If Flake-File or other [denful libs](https://github.com/denful) have been of use to you, consider [sponsoring](https://denful.dev/sponsor).

> NOTE: Den no longer relates to the <code>"Dendritic"</code> name, Den was born to explore the limits of that pattern and has evolved to something much more advanced and flexible, the official dendritic repo no longer considers this Dendritic.

**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,7 +32,7 @@ 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`
Expand All @@ -49,11 +51,11 @@ This means

</td></tr></table>

## Learn more: [Documentation](https://flake-file.oeiuwq.com)
## Learn more: [Documentation](https://flake-file.denful.dev)

## Try it Now!

```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
```
50 changes: 25 additions & 25 deletions dev/flake.lock

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

6 changes: 3 additions & 3 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 All @@ -26,7 +26,7 @@
treefmt-nix.follows = "treefmt-nix";
};
};
nixpkgs.url = "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz";
nixpkgs.url = "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.zst";
treefmt-nix = {
url = "github:numtide/treefmt-nix";
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 @@ -90,7 +90,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
20 changes: 10 additions & 10 deletions docs/src/components/Ad.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ 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>
<LinkButton href="https://denful.dev/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://denful.dev/">@vic'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/garden">garden</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>
Expand Down
8 changes: 4 additions & 4 deletions docs/src/components/FooterLinks.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ 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>

<a href="https://den.oeiuwq.com/community" class="sl-flex">
<a href="https://den.denful.dev/community/" class="sl-flex">
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
Expand All @@ -24,7 +24,7 @@ import { Icon } from '@astrojs/starlight/components';
Community
</a>

<a href="https://dendritic.oeiuwq.com/sponsor" class="sl-flex">
<a href="https://denful.dev/sponsor" class="sl-flex">
<Icon name="heart" size="1.2em" />
Sponsor
</a>
Expand All @@ -48,4 +48,4 @@ import { Icon } from '@astrojs/starlight/components';
a:hover {
color: var(--sl-color-white);
}
</style>
</style>
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://den.denful.dev"> <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/sponsor"><img src="https://img.shields.io/badge/Sponsor-@vic-white?logo=githubsponsors&logoColor=white" alt="Sponsor Den"/>
<a href="https://denful.dev/sponsor"><img src="https://img.shields.io/badge/Sponsor-@vic-white?logo=githubsponsors&logoColor=white" alt="Sponsor Den"/>
</a>

<Default />
2 changes: 1 addition & 1 deletion docs/src/content/docs/explanation/how-it-works.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Any Nix module can set `flake-file.*` options. Because this is the standard Nix

```nix
{ inputs, lib, ... }: {
flake-file.inputs.nixpkgs.url = lib.mkDefault "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-file.inputs.nixpkgs.url = lib.mkDefault "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.zst";
flake-file.inputs.nixpkgs-lib.follows = "nixpkgs";
}
```
Expand Down
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 [vic/vix](https://github.com/vic/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).
24 changes: 12 additions & 12 deletions docs/src/content/docs/guides/flake-modules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ 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`

Expand All @@ -38,13 +38,13 @@ A batteries-included setup for [Dendritic](https://vic.github.io/dendrix/Dendrit

flake-file = {
description = "My Awesome Flake";
inputs.nixpkgs.url = lib.mkDefault "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.nixpkgs.url = lib.mkDefault "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.zst";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
}
```

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,40 +60,40 @@ 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.auto-follow`

Enables automatic `follows` declarations maintained by [`flake-edit follow`](https://github.com/a-kenji/flake-edit). This is an alternative to the lock-flattening modules above.

Source: [`modules/auto-follow.nix`](https://github.com/vic/flake-file/tree/main/modules/auto-follow.nix)
Source: [`modules/auto-follow.nix`](https://github.com/denful/flake-file/tree/main/modules/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.tack`

Defines `flake-file` options for [tack](https://github.com/manic-systems/tack)-based environments: flake-like TOML pins, lazily fetched, with no `flake.lock`. Exposes `write-tack`, which renders `flake-file.inputs` into `.tack/pins.toml` and runs `tack update` to produce `.tack/pins.lock.json`. Extends `flake-file.inputs.<name>` with `tackType` (`flake`/`fetch`/`fixed`) and `unpack` (`tarball`/`file`) pin fields. Configure via `flake-file.tack.*` (package, shorturls, all-follow rules, recomposability, resolver overrides).

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