0e6b559d00
Run checks and build archives / coverage-and-sonar (push) Successful in 7m31s
Run checks and build archives / build (windows-x86_64) (push) Successful in 6m19s
Run checks and build archives / build (linux-aarch64) (push) Successful in 4m45s
Run checks and build archives / build (linux-x86_64) (push) Successful in 8m13s
29 lines
801 B
Nix
29 lines
801 B
Nix
{
|
|
target,
|
|
pkgs,
|
|
}: let
|
|
cargoToml = fromTOML (builtins.readFile ../Cargo.toml);
|
|
name = cargoToml.package.name;
|
|
version = cargoToml.package.version;
|
|
buildArgs = {
|
|
pname = name;
|
|
inherit version;
|
|
src = pkgs.lib.cleanSource ../.;
|
|
# cargoLock.lockFile = ../Cargo.lock;
|
|
cargoHash = "sha256-yfKaqc+7lvxDukAXxazc57GFs386rr9vUsDk1pobLRM=";
|
|
useNextest = true;
|
|
meta = {
|
|
inherit (cargoToml.package) description homepage;
|
|
};
|
|
postBuild = "${pkgs.upx}/bin/upx target/*/release/${name}${target.exeSuffix}";
|
|
};
|
|
rustVersion = pkgs.rust-bin.stable.latest.default.override {
|
|
targets = [target.triple];
|
|
};
|
|
rustPlatform = target.crossPkgs.makeRustPlatform {
|
|
cargo = rustVersion;
|
|
rustc = rustVersion;
|
|
};
|
|
in
|
|
rustPlatform.buildRustPackage buildArgs
|