summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlan Joselevich <personal@ilanjoselevich.com>2024-06-14 00:47:45 +0300
committerGitHub <noreply@github.com>2024-06-14 00:47:45 +0300
commit85d871cf14d161094a2ccd4ad9a84747f8a29222 (patch)
tree605f6968a98aba2e66f9c08dae50e423dfe9e131
parent3802a937da577a99662c86ba36398b588e501f59 (diff)
parent50261c0602f9df33074dae65c871d354517db4f7 (diff)
Merge pull request #319624 from flokli/rust-config
config.rust: update references from rustc
-rw-r--r--doc/languages-frameworks/rust.section.md14
-rw-r--r--lib/systems/examples.nix6
-rw-r--r--pkgs/applications/virtualization/rust-hypervisor-firmware/default.nix4
3 files changed, 12 insertions, 12 deletions
diff --git a/doc/languages-frameworks/rust.section.md b/doc/languages-frameworks/rust.section.md
index 8a1007b7bb8a..e12bbe02bfb5 100644
--- a/doc/languages-frameworks/rust.section.md
+++ b/doc/languages-frameworks/rust.section.md
@@ -254,7 +254,7 @@ By default, it takes the `stdenv.hostPlatform.config` and replaces components
where they are known to differ. But there are ways to customize the argument:
- To choose a different target by name, define
- `stdenv.hostPlatform.rustc.config` as that name (a string), and that
+ `stdenv.hostPlatform.rust.rustcTarget` as that name (a string), and that
name will be used instead.
For example:
@@ -262,7 +262,7 @@ where they are known to differ. But there are ways to customize the argument:
```nix
import <nixpkgs> {
crossSystem = (import <nixpkgs/lib>).systems.examples.armhf-embedded // {
- rustc.config = "thumbv7em-none-eabi";
+ rust.rustcTarget = "thumbv7em-none-eabi";
};
}
```
@@ -274,10 +274,10 @@ where they are known to differ. But there are ways to customize the argument:
```
- To pass a completely custom target, define
- `stdenv.hostPlatform.rustc.config` with its name, and
- `stdenv.hostPlatform.rustc.platform` with the value. The value will be
+ `stdenv.hostPlatform.rust.rustcTarget` with its name, and
+ `stdenv.hostPlatform.rust.platform` with the value. The value will be
serialized to JSON in a file called
- `${stdenv.hostPlatform.rustc.config}.json`, and the path of that file
+ `${stdenv.hostPlatform.rust.rustcTarget}.json`, and the path of that file
will be used instead.
For example:
@@ -285,8 +285,8 @@ where they are known to differ. But there are ways to customize the argument:
```nix
import <nixpkgs> {
crossSystem = (import <nixpkgs/lib>).systems.examples.armhf-embedded // {
- rustc.config = "thumb-crazy";
- rustc.platform = { foo = ""; bar = ""; };
+ rust.rustcTarget = "thumb-crazy";
+ rust.platform = { foo = ""; bar = ""; };
};
}
```
diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix
index 79ec4461e419..6a9427b2d9de 100644
--- a/lib/systems/examples.nix
+++ b/lib/systems/examples.nix
@@ -59,7 +59,7 @@ rec {
armv7a-android-prebuilt = {
config = "armv7a-unknown-linux-androideabi";
- rustc.config = "armv7-linux-androideabi";
+ rust.rustcTarget = "armv7-linux-androideabi";
sdkVer = "28";
ndkVer = "24";
useAndroidPrebuilt = true;
@@ -67,7 +67,7 @@ rec {
aarch64-android-prebuilt = {
config = "aarch64-unknown-linux-android";
- rustc.config = "aarch64-linux-android";
+ rust.rustcTarget = "aarch64-linux-android";
sdkVer = "28";
ndkVer = "24";
useAndroidPrebuilt = true;
@@ -207,7 +207,7 @@ rec {
aarch64-embedded = {
config = "aarch64-none-elf";
libc = "newlib";
- rustc.config = "aarch64-unknown-none";
+ rust.rustcTarget = "aarch64-unknown-none";
};
aarch64be-embedded = {
diff --git a/pkgs/applications/virtualization/rust-hypervisor-firmware/default.nix b/pkgs/applications/virtualization/rust-hypervisor-firmware/default.nix
index 3441b625c45e..8b408cc96ed4 100644
--- a/pkgs/applications/virtualization/rust-hypervisor-firmware/default.nix
+++ b/pkgs/applications/virtualization/rust-hypervisor-firmware/default.nix
@@ -17,8 +17,8 @@ let
cross = import ../../../.. {
system = hostPlatform.system;
crossSystem = lib.systems.examples."${arch}-embedded" // {
- rustc.config = "${arch}-unknown-none";
- rustc.platform = lib.importJSON target;
+ rust.rustcTarget = "${arch}-unknown-none";
+ rust.platform = lib.importJSON target;
};
};