From 75cda2da7fbd6283f88cf0fd0b934e1047ca1408 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 7 Jan 2025 13:40:18 +0100 Subject: [PATCH] Document path values in inputs Co-authored-by: Robert Hensing --- src/nix/flake.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/nix/flake.md b/src/nix/flake.md index a55bba4fc..5bb18328d 100644 --- a/src/nix/flake.md +++ b/src/nix/flake.md @@ -212,6 +212,13 @@ Currently the `type` attribute can be one of the following: root of a tree can use `path:./foo` to access the flake in subdirectory `foo`, but `path:../bar` is illegal. +Path inputs can be specified with path values in `flake.nix`. Path values are a syntax for `path` inputs, and they are converted by +1. resolving them into relative paths, relative to the base directory of `flake.nix` +2. escaping URL characters (refer to IETF RFC?) +3. prepending `path:` + +Note that the allowed syntax for path values in flake `inputs` may be more restrictive than general Nix, so you may need to use `path:` if your path contains certain special characters. See [Path literals](@docroot@/language/syntax#path-literal) + Note that if you omit `path:`, relative paths must start with `.` to avoid ambiguity with registry lookups (e.g. `nixpkgs` is a registry lookup; `./nixpkgs` is a relative path).