summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorValentin Gagarin <valentin.gagarin@tweag.io>2022-12-05 16:24:52 +0100
committerValentin Gagarin <valentin.gagarin@tweag.io>2022-12-07 16:47:30 +0100
commit53b5a47c12e45bcc55a1115429e231e8c325fd1e (patch)
tree199d433875cbe16252cdf372dea137c09eda585a /doc
parent5b9b93b9be4234aaf9cd53e3247a927225095514 (diff)
document Import From Derivation (IFD) policy
Diffstat (limited to 'doc')
-rw-r--r--doc/contributing/coding-conventions.chapter.md15
-rw-r--r--doc/languages-frameworks/javascript.section.md2
2 files changed, 16 insertions, 1 deletions
diff --git a/doc/contributing/coding-conventions.chapter.md b/doc/contributing/coding-conventions.chapter.md
index d6f6cfe2358d..134c0ca93cae 100644
--- a/doc/contributing/coding-conventions.chapter.md
+++ b/doc/contributing/coding-conventions.chapter.md
@@ -670,3 +670,18 @@ stdenv.mkDerivation {
...
}
```
+
+### Import From Derivation {#ssec-import-from-derivation}
+
+Import From Derivation (IFD) is disallowed in Nixpkgs for performance reasons:
+[Hydra] evaluates the entire package set, and sequential builds during evalation would increase evaluation times to become impractical.
+
+[Hydra]: https://github.com/NixOS/hydra
+
+Import From Derivation can be worked around in some cases by committing generated intermediate files to version control and reading those instead.
+
+<!-- TODO: remove the following and link to Nix manual once https://github.com/NixOS/nix/pull/7332 is merged -->
+
+See also [NixOS Wiki: Import From Derivation].
+
+[NixOS Wiki: Import From Derivation]: https://nixos.wiki/wiki/Import_From_Derivation
diff --git a/doc/languages-frameworks/javascript.section.md b/doc/languages-frameworks/javascript.section.md
index 5a17c124a8e1..cea0ede2d5be 100644
--- a/doc/languages-frameworks/javascript.section.md
+++ b/doc/languages-frameworks/javascript.section.md
@@ -332,7 +332,7 @@ mkYarnPackage rec {
## Outside of nixpkgs {#javascript-outside-nixpkgs}
-There are some other options available that can't be used inside nixpkgs. Those other options are written in Nix. Importing them in nixpkgs will require moving the source code into nixpkgs. Using [Import From Derivation](https://nixos.wiki/wiki/Import_From_Derivation) is not allowed in Hydra at present. If you are packaging something outside nixpkgs, those can be considered
+There are some other options available that can't be used inside nixpkgs. Those other options are written in Nix. Importing them in nixpkgs will require moving the source code into nixpkgs. Using [Import From Derivation](#ssec-import-from-derivation) is not allowed in Hydra at present. If you are packaging something outside nixpkgs, those can be considered
### npmlock2nix {#javascript-npmlock2nix}