Loading doc/languages-frameworks/rust.section.md +16 −17 Original line number Diff line number Diff line Loading @@ -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.rust.rustcTarget` as that name (a string), and that `stdenv.hostPlatform.rust.rustcTargetSpec` as that name (a string), and that name will be used instead. For example: Loading @@ -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 // { rust.rustcTarget = "thumbv7em-none-eabi"; rust.rustcTargetSpec = "thumbv7em-none-eabi"; }; } ``` Loading @@ -274,22 +274,24 @@ where they are known to differ. But there are ways to customize the argument: ``` - To pass a completely custom target, define `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.rust.rustcTarget}.json`, and the path of that file will be used instead. `stdenv.hostPlatform.rust.rustcTargetSpec` with the path to the custom target specification JSON file. Note that some tools like Cargo and some crates like `cc` make use of the file name of the target JSON. Therefore, do not use `./path/to/target-spec.json` directly, because it will be renamed by Nix. Instead, place it a directory and use `"${./path/to/dir}/target-spec.json"`. The directory should contain only this one file, to avoid unrelated changes causing unnecessary rebuilds. For example: ```nix import <nixpkgs> { crossSystem = (import <nixpkgs/lib>).systems.examples.armhf-embedded // { rust.rustcTarget = "thumb-crazy"; rust.platform = { foo = ""; bar = ""; }; crossSystem = { config = "mips64el-unknown-linux-gnuabi64"; # gcc = ...; # Config for C compiler omitted rust.rustcTargetSpec = "${./rust}/mips64el_mips3-unknown-linux-gnuabi64.json"; }; } ``` Loading @@ -297,12 +299,9 @@ where they are known to differ. But there are ways to customize the argument: will result in: ```shell --target /nix/store/asdfasdfsadf-thumb-crazy.json # contains {"foo":"","bar":""} --target /nix/store/...-rust/mips64el_mips3-unknown-linux-gnuabi64.json ``` Note that currently custom targets aren't compiled with `std`, so `cargo test` will fail. This can be ignored by adding `doCheck = false;` to your derivation. ### Running package tests {#running-package-tests} When using `buildRustPackage`, the `checkPhase` is enabled by default and runs Loading lib/systems/default.nix +85 −75 Original line number Diff line number Diff line Loading @@ -417,12 +417,20 @@ let // args // { rust = rust // { platform = rust.platform or ( if lib.hasSuffix ".json" (rust.rustcTargetSpec or "") then lib.importJSON rust.rustcTargetSpec else { } ) # Once args.rustc.platform.target-family is deprecated and # removed, there will no longer be any need to modify any # values from args.rust.platform, so we can drop all the # "args ? rust" etc. checks, and merge args.rust.platform in # /after/. platform = rust.platform or { } // { // { # https://doc.rust-lang.org/reference/conditional-compilation.html#target_arch arch = if rust ? platform then Loading Loading @@ -474,9 +482,10 @@ let .${vendor.name} or vendor.name; }; # The name of the rust target, even if it is custom. Adjustments are # because rust has slightly different naming conventions than we do. rustcTarget = # The name of the rust target if it is standard, or the json file # containing the custom target spec. Adjustments are because rust has # slightly different naming conventions than we do. rustcTargetSpec = let inherit (final.parsed) cpu kernel abi; cpu_ = Loading @@ -497,29 +506,30 @@ let "gnu" else abi.name; in # TODO: deprecate args.rustc in favour of args.rust after 23.05 is EOL. args.rust.rustcTarget or args.rustc.config or ( inferred = if final.isWasi then # Rust uses `wasm32-wasip?` rather than `wasm32-unknown-wasi`. # We cannot know which subversion does the user want, and # currently use WASI 0.1 as default for compatibility. Custom # users can set `rust.rustcTarget` to override it. if final.isWasi then # users can set `rust.rustcTargetSpec` to override it. "${cpu_}-wasip1" else "${cpu_}-${vendor_}-${kernel.name}${optionalString (abi.name != "unknown") "-${abi_}"}" ); # The name of the rust target if it is standard, or the json file # containing the custom target spec. rustcTargetSpec = rust.rustcTargetSpec or ( "${cpu_}-${vendor_}-${kernel.name}${optionalString (abi.name != "unknown") "-${abi_}"}"; in # TODO: deprecate args.rustc in favour of args.rust after 23.05 is EOL. args.rust.rustcTargetSpec or args.rustc.config or ( if rust ? platform then builtins.toFile (final.rust.rustcTarget + ".json") (toJSON rust.platform) # TODO: This breaks cc-rs and thus std support, so maybe remove support? builtins.toFile (rust.rustcTarget or inferred + ".json") (toJSON rust.platform) else final.rust.rustcTarget args.rust.rustcTarget or inferred ); # Do not use rustcTarget. Use rustcTargetSpec or cargoShortTarget. # TODO: Remove all in-tree usages, and deprecate rustcTarget = rust.rustcTarget or final.rust.cargoShortTarget; # The name of the rust target if it is standard, or the # basename of the file containing the custom target spec, # without the .json extension. Loading pkgs/applications/editors/vim/plugins/non-generated/zig-vim/default.nix +3 −3 Original line number Diff line number Diff line Loading @@ -6,13 +6,13 @@ }: vimUtils.buildVimPlugin { pname = "zig.vim"; version = "0-unstable-2026-02-13"; version = "0-unstable-2026-02-27"; src = fetchFromCodeberg { owner = "ziglang"; repo = "zig.vim"; rev = "f65b43b90cbc3e179b3146d2237f503783119ab8"; hash = "sha256-4Ssde+vLYn/NnL24sDW6Z+yDN2dWKaOFgrFYm1oVQjg="; rev = "366ef4855d22fd1377b81c382542466475b73a01"; hash = "sha256-bo6/lvDx8JCttwTVw1eAImF/b5Aa0ekDN5H6WI0TAdo="; }; passthru.updateScript = nix-update-script { Loading pkgs/applications/networking/cluster/terraform-providers/providers.json +2 −2 Original line number Diff line number Diff line Loading @@ -1310,11 +1310,11 @@ "vendorHash": "sha256-omxEb+ntQuHDfS2Rmt0rj0BF0Q2T8DLhobLua2uU/0o=" }, "tencentcloudstack_tencentcloud": { "hash": "sha256-T2pGaLv8uUBHi3MyLVLEfPleoHb3R2QuQa3pFEqxAoM=", "hash": "sha256-kEdt8shf0bLyPzz6Lysj0yyx6leLHl4g9BjuXRdWPVo=", "homepage": "https://registry.terraform.io/providers/tencentcloudstack/tencentcloud", "owner": "tencentcloudstack", "repo": "terraform-provider-tencentcloud", "rev": "v1.82.70", "rev": "v1.82.73", "spdx": "MPL-2.0", "vendorHash": null }, Loading pkgs/by-name/an/ananicy-rules-cachyos/package.nix +3 −3 Original line number Diff line number Diff line Loading @@ -7,13 +7,13 @@ stdenvNoCC.mkDerivation { pname = "ananicy-rules-cachyos"; version = "0-unstable-2026-02-23"; version = "0-unstable-2026-03-05"; src = fetchFromGitHub { owner = "CachyOS"; repo = "ananicy-rules"; rev = "fc76e0a3c558a7c67189cba69e6f91fb78dda66a"; hash = "sha256-Pxta9rudG3Hv6G91l5/VBqa5JvQ4OZo8u8oq2XnfH7Q="; rev = "c85891564f1c600042cefc38a20b3aa448786e7d"; hash = "sha256-0GEZroVztjSDIhLuW4XX8IQ+QwzENOkk44w8Dm5zw/o="; }; dontConfigure = true; Loading Loading
doc/languages-frameworks/rust.section.md +16 −17 Original line number Diff line number Diff line Loading @@ -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.rust.rustcTarget` as that name (a string), and that `stdenv.hostPlatform.rust.rustcTargetSpec` as that name (a string), and that name will be used instead. For example: Loading @@ -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 // { rust.rustcTarget = "thumbv7em-none-eabi"; rust.rustcTargetSpec = "thumbv7em-none-eabi"; }; } ``` Loading @@ -274,22 +274,24 @@ where they are known to differ. But there are ways to customize the argument: ``` - To pass a completely custom target, define `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.rust.rustcTarget}.json`, and the path of that file will be used instead. `stdenv.hostPlatform.rust.rustcTargetSpec` with the path to the custom target specification JSON file. Note that some tools like Cargo and some crates like `cc` make use of the file name of the target JSON. Therefore, do not use `./path/to/target-spec.json` directly, because it will be renamed by Nix. Instead, place it a directory and use `"${./path/to/dir}/target-spec.json"`. The directory should contain only this one file, to avoid unrelated changes causing unnecessary rebuilds. For example: ```nix import <nixpkgs> { crossSystem = (import <nixpkgs/lib>).systems.examples.armhf-embedded // { rust.rustcTarget = "thumb-crazy"; rust.platform = { foo = ""; bar = ""; }; crossSystem = { config = "mips64el-unknown-linux-gnuabi64"; # gcc = ...; # Config for C compiler omitted rust.rustcTargetSpec = "${./rust}/mips64el_mips3-unknown-linux-gnuabi64.json"; }; } ``` Loading @@ -297,12 +299,9 @@ where they are known to differ. But there are ways to customize the argument: will result in: ```shell --target /nix/store/asdfasdfsadf-thumb-crazy.json # contains {"foo":"","bar":""} --target /nix/store/...-rust/mips64el_mips3-unknown-linux-gnuabi64.json ``` Note that currently custom targets aren't compiled with `std`, so `cargo test` will fail. This can be ignored by adding `doCheck = false;` to your derivation. ### Running package tests {#running-package-tests} When using `buildRustPackage`, the `checkPhase` is enabled by default and runs Loading
lib/systems/default.nix +85 −75 Original line number Diff line number Diff line Loading @@ -417,12 +417,20 @@ let // args // { rust = rust // { platform = rust.platform or ( if lib.hasSuffix ".json" (rust.rustcTargetSpec or "") then lib.importJSON rust.rustcTargetSpec else { } ) # Once args.rustc.platform.target-family is deprecated and # removed, there will no longer be any need to modify any # values from args.rust.platform, so we can drop all the # "args ? rust" etc. checks, and merge args.rust.platform in # /after/. platform = rust.platform or { } // { // { # https://doc.rust-lang.org/reference/conditional-compilation.html#target_arch arch = if rust ? platform then Loading Loading @@ -474,9 +482,10 @@ let .${vendor.name} or vendor.name; }; # The name of the rust target, even if it is custom. Adjustments are # because rust has slightly different naming conventions than we do. rustcTarget = # The name of the rust target if it is standard, or the json file # containing the custom target spec. Adjustments are because rust has # slightly different naming conventions than we do. rustcTargetSpec = let inherit (final.parsed) cpu kernel abi; cpu_ = Loading @@ -497,29 +506,30 @@ let "gnu" else abi.name; in # TODO: deprecate args.rustc in favour of args.rust after 23.05 is EOL. args.rust.rustcTarget or args.rustc.config or ( inferred = if final.isWasi then # Rust uses `wasm32-wasip?` rather than `wasm32-unknown-wasi`. # We cannot know which subversion does the user want, and # currently use WASI 0.1 as default for compatibility. Custom # users can set `rust.rustcTarget` to override it. if final.isWasi then # users can set `rust.rustcTargetSpec` to override it. "${cpu_}-wasip1" else "${cpu_}-${vendor_}-${kernel.name}${optionalString (abi.name != "unknown") "-${abi_}"}" ); # The name of the rust target if it is standard, or the json file # containing the custom target spec. rustcTargetSpec = rust.rustcTargetSpec or ( "${cpu_}-${vendor_}-${kernel.name}${optionalString (abi.name != "unknown") "-${abi_}"}"; in # TODO: deprecate args.rustc in favour of args.rust after 23.05 is EOL. args.rust.rustcTargetSpec or args.rustc.config or ( if rust ? platform then builtins.toFile (final.rust.rustcTarget + ".json") (toJSON rust.platform) # TODO: This breaks cc-rs and thus std support, so maybe remove support? builtins.toFile (rust.rustcTarget or inferred + ".json") (toJSON rust.platform) else final.rust.rustcTarget args.rust.rustcTarget or inferred ); # Do not use rustcTarget. Use rustcTargetSpec or cargoShortTarget. # TODO: Remove all in-tree usages, and deprecate rustcTarget = rust.rustcTarget or final.rust.cargoShortTarget; # The name of the rust target if it is standard, or the # basename of the file containing the custom target spec, # without the .json extension. Loading
pkgs/applications/editors/vim/plugins/non-generated/zig-vim/default.nix +3 −3 Original line number Diff line number Diff line Loading @@ -6,13 +6,13 @@ }: vimUtils.buildVimPlugin { pname = "zig.vim"; version = "0-unstable-2026-02-13"; version = "0-unstable-2026-02-27"; src = fetchFromCodeberg { owner = "ziglang"; repo = "zig.vim"; rev = "f65b43b90cbc3e179b3146d2237f503783119ab8"; hash = "sha256-4Ssde+vLYn/NnL24sDW6Z+yDN2dWKaOFgrFYm1oVQjg="; rev = "366ef4855d22fd1377b81c382542466475b73a01"; hash = "sha256-bo6/lvDx8JCttwTVw1eAImF/b5Aa0ekDN5H6WI0TAdo="; }; passthru.updateScript = nix-update-script { Loading
pkgs/applications/networking/cluster/terraform-providers/providers.json +2 −2 Original line number Diff line number Diff line Loading @@ -1310,11 +1310,11 @@ "vendorHash": "sha256-omxEb+ntQuHDfS2Rmt0rj0BF0Q2T8DLhobLua2uU/0o=" }, "tencentcloudstack_tencentcloud": { "hash": "sha256-T2pGaLv8uUBHi3MyLVLEfPleoHb3R2QuQa3pFEqxAoM=", "hash": "sha256-kEdt8shf0bLyPzz6Lysj0yyx6leLHl4g9BjuXRdWPVo=", "homepage": "https://registry.terraform.io/providers/tencentcloudstack/tencentcloud", "owner": "tencentcloudstack", "repo": "terraform-provider-tencentcloud", "rev": "v1.82.70", "rev": "v1.82.73", "spdx": "MPL-2.0", "vendorHash": null }, Loading
pkgs/by-name/an/ananicy-rules-cachyos/package.nix +3 −3 Original line number Diff line number Diff line Loading @@ -7,13 +7,13 @@ stdenvNoCC.mkDerivation { pname = "ananicy-rules-cachyos"; version = "0-unstable-2026-02-23"; version = "0-unstable-2026-03-05"; src = fetchFromGitHub { owner = "CachyOS"; repo = "ananicy-rules"; rev = "fc76e0a3c558a7c67189cba69e6f91fb78dda66a"; hash = "sha256-Pxta9rudG3Hv6G91l5/VBqa5JvQ4OZo8u8oq2XnfH7Q="; rev = "c85891564f1c600042cefc38a20b3aa448786e7d"; hash = "sha256-0GEZroVztjSDIhLuW4XX8IQ+QwzENOkk44w8Dm5zw/o="; }; dontConfigure = true; Loading