flake-file
What it does
Section titled “What it does”Nix flakes require flake.nix to be written in a restricted subset of Nix — no imports, no lib.mkDefault, no computed values. flake-file removes this limitation:
- Define inputs anywhere — in any Nix module, using full Nix language features
- Typed schemas — Input and Output definitions based on Nix types
- One-command regeneration —
nix run .#write-flakeproduces a cleanflake.nix - Consistency checks —
flake checkensures generated files stay in sync - Multiple backends — supports
flake.nix,unflake.nix, andnpins/ - Automatic lock flattening — via allfollow or nix-auto-follow
Example
Section titled “Example”# modules/inputs.nix — define inputs using real Nix{ lib, ... }: { flake.inputs.nixpkgs.url = lib.mkDefault "github:NixOS/nixpkgs/nixos-${channel}"; flake.inputs.home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; };}Then regenerate:
nix run .#write-flakeWho uses it
Section titled “Who uses it”Used across the Dendritic ecosystem — den, checkmate, dendrix, and many flake-aspects users rely on flake-file for maintainable flake definitions.
Source Code Documentation Support this project