summary refs log tree commit diff
path: root/doc
diff options
context:
space:
mode:
authorFrederik Rietdijk <fridh@fridh.nl>2021-02-26 10:25:13 +0100
committerFrederik Rietdijk <fridh@fridh.nl>2021-02-26 10:25:13 +0100
commitc456a2512f7a7558cbe25328a423762033822cc0 (patch)
treed64f521751037012a1c4d05fedeb485eeee39b05 /doc
parentbabf9d6100c3e5dcdbbbe8850de99d3fe2b3cf86 (diff)
parent6d7128414cf2763ab14f31365c21c6cec3547dac (diff)
downloadnixpkgs-c456a2512f7a7558cbe25328a423762033822cc0.tar
nixpkgs-c456a2512f7a7558cbe25328a423762033822cc0.tar.gz
nixpkgs-c456a2512f7a7558cbe25328a423762033822cc0.tar.bz2
nixpkgs-c456a2512f7a7558cbe25328a423762033822cc0.tar.lz
nixpkgs-c456a2512f7a7558cbe25328a423762033822cc0.tar.xz
nixpkgs-c456a2512f7a7558cbe25328a423762033822cc0.tar.zst
nixpkgs-c456a2512f7a7558cbe25328a423762033822cc0.zip
Merge master into staging-next
Diffstat (limited to 'doc')
-rw-r--r--doc/languages-frameworks/rust.section.md27
-rw-r--r--doc/using/configuration.xml12
2 files changed, 33 insertions, 6 deletions
diff --git a/doc/languages-frameworks/rust.section.md b/doc/languages-frameworks/rust.section.md
index 2290d92f7ad..94f94aaffe3 100644
--- a/doc/languages-frameworks/rust.section.md
+++ b/doc/languages-frameworks/rust.section.md
@@ -80,6 +80,33 @@ The fetcher will verify that the `Cargo.lock` file is in sync with the `src`
 attribute, and fail the build if not. It will also will compress the vendor
 directory into a tar.gz archive.
 
+The tarball with vendored dependencies contains a directory with the
+package's `name`, which is normally composed of `pname` and
+`version`. This means that the vendored dependencies hash
+(`cargoSha256`/`cargoHash`) is dependent on the package name and
+version. The `cargoDepsName` attribute can be used to use another name
+for the directory of vendored dependencies. For example, the hash can
+be made invariant to the version by setting `cargoDepsName` to
+`pname`:
+
+```nix
+rustPlatform.buildRustPackage rec {
+  pname = "broot";
+  version = "1.2.0";
+
+  src = fetchCrate {
+    inherit pname version;
+    sha256 = "1mqaynrqaas82f5957lx31x80v74zwmwmjxxlbywajb61vh00d38";
+  };
+
+  cargoHash = "sha256-JmBZcDVYJaK1cK05cxx5BrnGWp4t8ca6FLUbvIot67s=";
+  cargoDepsName = pname;
+
+  # ...
+}
+```
+
+
 ### Cross compilation
 
 By default, Rust packages are compiled for the host platform, just like any
diff --git a/doc/using/configuration.xml b/doc/using/configuration.xml
index 2cd2615f54a..8e63e0072c8 100644
--- a/doc/using/configuration.xml
+++ b/doc/using/configuration.xml
@@ -151,26 +151,26 @@
    </listitem>
    <listitem>
     <para>
-     It is also possible to whitelist and blacklist licenses that are specifically acceptable or not acceptable, using <literal>whitelistedLicenses</literal> and <literal>blacklistedLicenses</literal>, respectively.
+     It is also possible to allow and block licenses that are specifically acceptable or not acceptable, using <literal>allowlistedLicenses</literal> and <literal>blocklistedLicenses</literal>, respectively.
     </para>
     <para>
-     The following example configuration whitelists the licenses <literal>amd</literal> and <literal>wtfpl</literal>:
+     The following example configuration allowlists the licenses <literal>amd</literal> and <literal>wtfpl</literal>:
 <programlisting>
 {
-  whitelistedLicenses = with lib.licenses; [ amd wtfpl ];
+  allowlistedLicenses = with lib.licenses; [ amd wtfpl ];
 }
 </programlisting>
     </para>
     <para>
-     The following example configuration blacklists the <literal>gpl3Only</literal> and <literal>agpl3Only</literal> licenses:
+     The following example configuration blocklists the <literal>gpl3Only</literal> and <literal>agpl3Only</literal> licenses:
 <programlisting>
 {
-  blacklistedLicenses = with lib.licenses; [ agpl3Only gpl3Only ];
+  blocklistedLicenses = with lib.licenses; [ agpl3Only gpl3Only ];
 }
 </programlisting>
     </para>
     <para>
-      Note that <literal>whitelistedLicenses</literal> only applies to unfree licenses unless <literal>allowUnfree</literal> is enabled. It is not a generic whitelist for all types of licenses. <literal>blacklistedLicenses</literal> applies to all licenses.
+      Note that <literal>allowlistedLicenses</literal> only applies to unfree licenses unless <literal>allowUnfree</literal> is enabled. It is not a generic allowlist for all types of licenses. <literal>blocklistedLicenses</literal> applies to all licenses.
     </para>
    </listitem>
   </itemizedlist>