Skip to content

flake-file

Your flake.nix, made modular and maintainable.
Use the real Nix language to define your inputs.

flake-file lets you generate a clean, maintainable flake.nix from modular Nix options.

Define inputs close to where they are used — in any Nix module — then with a single command, write flake.nix or unflake.nix or npins.

Terminal window
mv flake.nix flake-file.nix
nix-shell https://github.com/vic/flake-file/archive/main.tar.gz -A flake-file.sh --run bootstrap

Modular Inputs

Define flake.nix inputs in separate modules using the Nix module system and the real Nix language features. Use lib.mkDefault or interpolate Nix expressions, etc.

Input and Output Flake Schemas

Not only your input definitions are checked by a typed schema, but you can also define custom schemas for your flake outputs.

Lock Flattening

Built-in support for automatic flake.lock flattening via allfollow or nix-auto-follow.

Multiple Backends

Generate flake.nix, unflake.nix, nixlock, or npins/ from the same module options. Switch backends without rewriting your modules.

Run nix run .#write-flake to regenerate flake.nix from your options. A flake check enforces that files stay in sync. Also provides nix-shell commands for stable Nix world.

Contribute Community Sponsor