[nix] Add extra Rust components to the flake (#2109)

This commit is contained in:
Salvador Girones Gil 2023-06-06 17:38:11 +02:00 committed by GitHub
parent de016af929
commit f000e9232f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -47,13 +47,13 @@
flake = self;
};
mkRustToolchain = target:
mkRustToolchain = {target, extraComponents ? []}:
with fenix.packages.${system};
combine [
combine ([
stable.rustc
stable.cargo
targets.${target}.stable.rust-std
];
] ++ extraComponents);
buildPlatform = pkgs.stdenv.buildPlatform.config;
@ -87,7 +87,7 @@
import ./pkg/nix/spec/${target}.nix { inherit pkgs target util; };
in import ./pkg/nix/drv/binary.nix {
inherit pkgs util spec crane;
rustToolchain = mkRustToolchain target;
rustToolchain = mkRustToolchain { inherit target; };
}) util.platforms);
devShells = {
@ -108,7 +108,8 @@
spec = (import ./pkg/nix/spec/${target}.nix) {
inherit pkgs target util;
};
rustToolchain = mkRustToolchain target;
extraComponents = with fenix.packages.${system}; [ targets.${target}.stable.rust-src rust-analyzer targets.${target}.stable.rustfmt ];
rustToolchain = mkRustToolchain { inherit target extraComponents; };
buildSpec = spec.buildSpec;
in pkgs.mkShell (buildSpec // {
hardeningDisable = [ "fortify" ];