Files
nixpkgs/pkgs/development/compilers/rust/make-rust-platform.nix
T
Silvan Mosberger 84d4f874c2 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build https://github.com/infinisil/treewide-nixpkgs-reformat-script/archive/a08b3a4d199c6124ac5b36a889d9099b4383463f.tar.gz \
      --argstr baseRev 78e9caf153
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:23:58 +01:00

79 lines
1.6 KiB
Nix

{
lib,
buildPackages,
callPackage,
callPackages,
cargo-auditable,
config,
stdenv,
runCommand,
}@prev:
{
rustc,
cargo,
cargo-auditable ? prev.cargo-auditable,
stdenv ? prev.stdenv,
...
}:
rec {
fetchCargoTarball = buildPackages.callPackage ../../../build-support/rust/fetch-cargo-tarball {
git = buildPackages.gitMinimal;
inherit cargo;
};
fetchCargoVendor = buildPackages.callPackage ../../../build-support/rust/fetch-cargo-vendor.nix {
inherit cargo;
};
buildRustPackage = callPackage ../../../build-support/rust/build-rust-package {
inherit
stdenv
cargoBuildHook
cargoCheckHook
cargoInstallHook
cargoNextestHook
cargoSetupHook
fetchCargoTarball
fetchCargoVendor
importCargoLock
rustc
cargo
cargo-auditable
;
};
importCargoLock = buildPackages.callPackage ../../../build-support/rust/import-cargo-lock.nix {
inherit cargo;
};
rustcSrc = callPackage ./rust-src.nix {
inherit runCommand rustc;
};
rustLibSrc = callPackage ./rust-lib-src.nix {
inherit runCommand rustc;
};
# Hooks
inherit
(callPackages ../../../build-support/rust/hooks {
inherit stdenv cargo rustc;
})
cargoBuildHook
cargoCheckHook
cargoInstallHook
cargoNextestHook
cargoSetupHook
maturinBuildHook
bindgenHook
;
}
// lib.optionalAttrs config.allowAliases {
rust = {
rustc = lib.warn "rustPlatform.rust.rustc is deprecated. Use rustc instead." rustc;
cargo = lib.warn "rustPlatform.rust.cargo is deprecated. Use cargo instead." cargo;
};
}