about summary refs log tree commit diff
path: root/doc/languages-frameworks
diff options
context:
space:
mode:
authorexfalso <0slemi0@gmail.com>2019-11-01 14:19:39 +0000
committerexfalso <0slemi0@gmail.com>2019-11-01 14:19:39 +0000
commitbb7184d6a62f3eefdadb069091f8985871279b15 (patch)
tree3d35e8d5bc5dea6d2d021358bc17f74f5a0eeb11 /doc/languages-frameworks
parenta588b1dfbc83c0915f2b4cf097d4892730b03482 (diff)
downloadnixlib-bb7184d6a62f3eefdadb069091f8985871279b15.tar
nixlib-bb7184d6a62f3eefdadb069091f8985871279b15.tar.gz
nixlib-bb7184d6a62f3eefdadb069091f8985871279b15.tar.bz2
nixlib-bb7184d6a62f3eefdadb069091f8985871279b15.tar.lz
nixlib-bb7184d6a62f3eefdadb069091f8985871279b15.tar.xz
nixlib-bb7184d6a62f3eefdadb069091f8985871279b15.tar.zst
nixlib-bb7184d6a62f3eefdadb069091f8985871279b15.zip
buildRustPackage: Add readme comment on target option
Diffstat (limited to 'doc/languages-frameworks')
-rw-r--r--doc/languages-frameworks/rust.section.md11
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/languages-frameworks/rust.section.md b/doc/languages-frameworks/rust.section.md
index 83b7b159bd63..5fb5d380d8b2 100644
--- a/doc/languages-frameworks/rust.section.md
+++ b/doc/languages-frameworks/rust.section.md
@@ -68,6 +68,17 @@ build-time.
 When `verifyCargoDeps` is set to `true`, the build will also verify that the
 `cargoSha256` is not out of date by comparing the `Cargo.lock` file in both the `cargoDeps` and `src`. Note that this option changes the value of `cargoSha256` since it also copies the `Cargo.lock` in it. To avoid breaking backward-compatibility this option is not enabled by default but hopefully will be in the future.
 
+### Building a crate for a different target
+
+To build your crate with a different cargo `--target` simply specify the `target` attribute:
+
+```nix
+pkgs.rustPlatform.buildRustPackage {
+  (...)
+  target = "x86_64-fortanix-unknown-sgx";
+}
+```
+
 ## Compiling Rust crates using Nix instead of Cargo
 
 ### Simple operation