1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00

Merge pull request #13728 from NixOS/mergify/bp/2.30-maintenance/pr-13726

docs: add self-attrs documentation (backport #13726)
This commit is contained in:
mergify[bot] 2025-08-10 15:56:55 +00:00 committed by GitHub
commit 1a0f70dd7c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -573,6 +573,27 @@ The value of the `follows` attribute is a `/`-separated sequence of
input names denoting the path of inputs to be followed from the root
flake.
## Self-attributes
Flakes can declare attributes about themselves that affect how they are fetched.
These attributes are specified using the special `self` input and are retroactively
applied to it:
```nix
{
inputs.self.submodules = true;
inputs.self.lfs = true;
}
```
The following self-attributes are supported:
* `submodules`: A Boolean denoting whether Git submodules should be fetched when this flake is used as an input. When set to `true`, Git submodules will be automatically fetched without requiring callers to specify `submodules=1` in the flake reference URL. Defaults to `false`.
* `lfs`: A Boolean denoting whether Git LFS (Large File Storage) files should be fetched when this flake is used as an input. When set to `true`, Git LFS files will be automatically fetched. Defaults to `false`.
These self-attributes eliminate the need for consumers of your flake to manually specify fetching options in their flake references.
Overrides and `follows` can be combined, e.g.
```nix