nix: link multicall binaries with cargo-xtask
This commit is contained in:
parent
3d02eb2d51
commit
820b73e0d8
2 changed files with 21 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
rustPlatform,
|
rustPlatform,
|
||||||
|
stdenv,
|
||||||
}:
|
}:
|
||||||
rustPlatform.buildRustPackage (finalAttrs: {
|
rustPlatform.buildRustPackage (finalAttrs: {
|
||||||
pname = "eh";
|
pname = "eh";
|
||||||
|
@ -21,11 +22,28 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
||||||
]);
|
]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# xtask doesn't support passing --targe
|
||||||
|
# but nix hooks expect the folder structure from when it's set
|
||||||
|
env.CARGO_BUILD_TARGET = stdenv.hostPlatform.rust.cargoShortTarget;
|
||||||
cargoLock.lockFile = "${finalAttrs.src}/Cargo.lock";
|
cargoLock.lockFile = "${finalAttrs.src}/Cargo.lock";
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
# Install required files with the 'dist' task
|
||||||
|
$out/bin/xtask multicall \
|
||||||
|
--bin-dir $out/bin \
|
||||||
|
--main-binary $out/bin/eh
|
||||||
|
|
||||||
|
# The xtask output has been built as a part of the build phase. If
|
||||||
|
# we don't remove it, it'll be linked in $out/bin alongside the actual
|
||||||
|
# binary and populate $PATH with a dedicated 'xtask' command. Remove.
|
||||||
|
rm -rf $out/bin/xtask
|
||||||
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "Ergonomic Nix CLI helper";
|
description = "Ergonomic Nix CLI helper";
|
||||||
maintainers = with lib.licenses; [NotAShelf];
|
maintainers = with lib.licenses; [NotAShelf];
|
||||||
|
license = lib.licenses.mpl20;
|
||||||
|
mainProgram = "eh";
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
rustfmt,
|
rustfmt,
|
||||||
clippy,
|
clippy,
|
||||||
cargo,
|
cargo,
|
||||||
|
taplo,
|
||||||
rustPlatform,
|
rustPlatform,
|
||||||
}:
|
}:
|
||||||
mkShell {
|
mkShell {
|
||||||
|
@ -13,6 +14,8 @@ mkShell {
|
||||||
rustfmt
|
rustfmt
|
||||||
clippy
|
clippy
|
||||||
cargo
|
cargo
|
||||||
|
|
||||||
|
taplo
|
||||||
];
|
];
|
||||||
|
|
||||||
RUST_SRC_PATH = "${rustPlatform.rustLibSrc}";
|
RUST_SRC_PATH = "${rustPlatform.rustLibSrc}";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue