forked from lix-project/lix
Docs: Explain why import nixpkgs
works in flakes
This commit is contained in:
parent
56dc6ed841
commit
605c8f7789
|
@ -254,9 +254,14 @@ static RegisterPrimOp primop_import({
|
||||||
.args = {"path"},
|
.args = {"path"},
|
||||||
// TODO turn "normal path values" into link below
|
// TODO turn "normal path values" into link below
|
||||||
.doc = R"(
|
.doc = R"(
|
||||||
Load, parse and return the Nix expression in the file *path*. If
|
Load, parse and return the Nix expression in the file *path*.
|
||||||
*path* is a directory, the file ` default.nix ` in that directory
|
|
||||||
is loaded. Evaluation aborts if the file doesn’t exist or contains
|
The value *path* is conveted to a string as described in `builtins.toString`.
|
||||||
|
|
||||||
|
If *path* is a directory, the file ` default.nix ` in that directory
|
||||||
|
is loaded.
|
||||||
|
|
||||||
|
Evaluation aborts if the file doesn’t exist or contains
|
||||||
an incorrect Nix expression. `import` implements Nix’s module
|
an incorrect Nix expression. `import` implements Nix’s module
|
||||||
system: you can put any Nix expression (such as a set or a
|
system: you can put any Nix expression (such as a set or a
|
||||||
function) in a separate file, and use it from Nix expressions in
|
function) in a separate file, and use it from Nix expressions in
|
||||||
|
|
|
@ -317,6 +317,8 @@ The following attributes are supported in `flake.nix`:
|
||||||
also contains some metadata about the inputs. These are:
|
also contains some metadata about the inputs. These are:
|
||||||
|
|
||||||
* `outPath`: The path in the Nix store of the flake's source tree.
|
* `outPath`: The path in the Nix store of the flake's source tree.
|
||||||
|
This way, the attribute set can be passed to `import` as if it was a path,
|
||||||
|
as in the example above (`import nixpkgs`).
|
||||||
|
|
||||||
* `rev`: The commit hash of the flake's repository, if applicable.
|
* `rev`: The commit hash of the flake's repository, if applicable.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue