Options Reference
All options are set under the flake-file namespace in any flake-parts module.
See the source: modules/options/default.nix
Top-level Options
Section titled “Top-level Options”| Option | Type | Description |
|---|---|---|
flake-file.description | str | Flake description string |
flake-file.nixConfig | attrs | Nix binary cache / substituter config (free-form attrset) |
flake-file.outputs | str | Literal Nix expression for the outputs function |
flake-file.formatter | pkgs -> drv | Function producing the formatter used on the generated file |
flake-file.do-not-edit | str | Header comment written at the top of the generated file |
Input Options
Section titled “Input Options”Each input is declared under flake-file.inputs.<name>.
| Option | Type | Description |
|---|---|---|
flake-file.inputs.<name>.url | str | Source URL — e.g. github:owner/repo |
flake-file.inputs.<name>.type | str | Reference type — github, path, git, etc. |
flake-file.inputs.<name>.owner | str | Owner (for typed VCS refs) |
flake-file.inputs.<name>.repo | str | Repository name |
flake-file.inputs.<name>.path | str | Local path reference |
flake-file.inputs.<name>.id | str | Flake registry id |
flake-file.inputs.<name>.dir | str | Subdirectory within repo or path |
flake-file.inputs.<name>.narHash | str | NAR hash pin |
flake-file.inputs.<name>.rev | str | Commit hash pin |
flake-file.inputs.<name>.ref | str | Branch or tag pin |
flake-file.inputs.<name>.host | str | Custom host for git forges |
flake-file.inputs.<name>.submodules | bool | Whether to fetch git submodules |
flake-file.inputs.<name>.flake | bool | Is the input a flake? (default: true) |
flake-file.inputs.<name>.follows | str | Follow another input’s resolved value |
flake-file.inputs.<name>.inputs.<dep>.follows | str | Nested transitive follow |
flake-file.inputs.<name>.inputs.<dep>.inputs... | … | Recursively follow deeper transitive deps |
Example
Section titled “Example”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";};Hook Options
Section titled “Hook Options”| Option | Type | Description |
|---|---|---|
flake-file.write-hooks | listOf hookType | Ordered hooks run after write-flake writes the file |
flake-file.check-hooks | listOf hookType | Ordered hooks run during flake check |
Each hook has:
| Field | Description |
|---|---|
index | Integer — lower index runs first |
exec | Shell command string to execute |
Lock Flattening Options
Section titled “Lock Flattening Options”| Option | Type | Description |
|---|---|---|
flake-file.prune-lock.enable | bool | Enable automatic flake.lock pruning after writing |
flake-file.prune-lock.program | pkgs -> drv | Function building the lock-pruning executable |
See Lock Flattening guide for usage.