aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKjetil Orbekk <kj@orbekk.com>2022-01-30 11:30:57 -0500
committerKjetil Orbekk <kj@orbekk.com>2022-04-29 18:46:21 -0400
commitc21afd684cb5f59337b879684728884fd8275ce4 (patch)
treec1548e306510b09f1ad049eeb4fbe94870ce1aac /src
parent1203e489263fe867d0a1ae3fd9270f40c8a1c24e (diff)
Update `nix flake` documentation of `ref` handling
Update the documentation about how `ref` is resolved if it is not specified. Add a note about special handling of local workdirs with `git+file`.
Diffstat (limited to 'src')
-rw-r--r--src/nix/flake.md7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/nix/flake.md b/src/nix/flake.md
index 7d179a6c4..c8251eb74 100644
--- a/src/nix/flake.md
+++ b/src/nix/flake.md
@@ -153,7 +153,7 @@ Currently the `type` attribute can be one of the following:
git(+http|+https|+ssh|+git|+file|):(//<server>)?<path>(\?<params>)?
```
- The `ref` attribute defaults to `master`.
+ The `ref` attribute defaults to resolving the `HEAD` reference.
The `rev` attribute must denote a commit that exists in the branch
or tag specified by the `ref` attribute, since Nix doesn't do a full
@@ -161,6 +161,11 @@ Currently the `type` attribute can be one of the following:
doesn't allow fetching a `rev` without a known `ref`). The default
is the commit currently pointed to by `ref`.
+ When `git+file` is used without specifying `ref` or `rev`, files are
+ fetched directly from the local `path` as long as they have been added
+ to the Git repository. If there are uncommitted changes, the reference
+ is treated as dirty and a warning is printed.
+
For example, the following are valid Git flake references:
* `git+https://example.org/my/repo`