Skip to content

Options Reference

All options are set under the flake-file namespace in any flake-parts module.

See the source: modules/options/default.nix

OptionTypeDescription
flake-file.descriptionstrFlake description string
flake-file.nixConfigattrsNix binary cache / substituter config (free-form attrset)
flake-file.outputsstrLiteral Nix expression for the outputs function
flake-file.formatterpkgs -> drvFunction producing the formatter used on the generated file
flake-file.do-not-editstrHeader comment written at the top of the generated file

Each input is declared under flake-file.inputs.<name>.

OptionTypeDescription
flake-file.inputs.<name>.urlstrSource URL — e.g. github:owner/repo
flake-file.inputs.<name>.typestrReference type — github, path, git, etc.
flake-file.inputs.<name>.ownerstrOwner (for typed VCS refs)
flake-file.inputs.<name>.repostrRepository name
flake-file.inputs.<name>.pathstrLocal path reference
flake-file.inputs.<name>.idstrFlake registry id
flake-file.inputs.<name>.dirstrSubdirectory within repo or path
flake-file.inputs.<name>.narHashstrNAR hash pin
flake-file.inputs.<name>.revstrCommit hash pin
flake-file.inputs.<name>.refstrBranch or tag pin
flake-file.inputs.<name>.hoststrCustom host for git forges
flake-file.inputs.<name>.submodulesboolWhether to fetch git submodules
flake-file.inputs.<name>.flakeboolIs the input a flake? (default: true)
flake-file.inputs.<name>.followsstrFollow another input’s resolved value
flake-file.inputs.<name>.inputs.<dep>.followsstrNested transitive follow
flake-file.inputs.<name>.inputs.<dep>.inputs...Recursively follow deeper transitive deps
flake-file = {
description = "my awesome flake";
nixConfig = {};
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.nixpkgs-lib.follows = "nixpkgs";
inputs.my-tool.flake = false;
inputs.my-tool.url = "github:owner/my-tool";
inputs.dep.inputs.nixpkgs.follows = "nixpkgs";
};
OptionTypeDescription
flake-file.write-hookslistOf hookTypeOrdered hooks run after write-flake writes the file
flake-file.check-hookslistOf hookTypeOrdered hooks run during flake check

Each hook has:

FieldDescription
indexInteger — lower index runs first
execShell command string to execute
OptionTypeDescription
flake-file.prune-lock.enableboolEnable automatic flake.lock pruning after writing
flake-file.prune-lock.programpkgs -> drvFunction building the lock-pruning executable

See Lock Flattening guide for usage.

Contribute Community Sponsor