diff options
author | Joachim Breitner <mail@joachim-breitner.de> | 2023-03-28 09:35:49 +0200 |
---|---|---|
committer | Joachim Breitner <mail@joachim-breitner.de> | 2023-03-28 09:35:49 +0200 |
commit | 605c8f7789d9ef446c8f22d8c6a261b315be861d (patch) | |
tree | 3a24389df97b3ee07dfb54ab2d8e882d8e2570e4 /src/libexpr | |
parent | 56dc6ed8410510033b835d48b3bd22766e8349a0 (diff) |
Docs: Explain why `import nixpkgs` works in flakes
Diffstat (limited to 'src/libexpr')
-rw-r--r-- | src/libexpr/primops.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 3641ee468..73ffe03d4 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -254,9 +254,14 @@ static RegisterPrimOp primop_import({ .args = {"path"}, // TODO turn "normal path values" into link below .doc = R"( - Load, parse and return the Nix expression in the file *path*. If - *path* is a directory, the file ` default.nix ` in that directory - is loaded. Evaluation aborts if the file doesn’t exist or contains + Load, parse and return the Nix expression in the file *path*. + + 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 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 |