c1c25e33ff
Run checks and build archives / coverage-and-sonar (push) Successful in 6m57s
Run checks and build archives / build (linux-aarch64) (push) Successful in 1m56s
Run checks and build archives / build (windows-x86_64) (push) Successful in 1m38s
Run checks and build archives / build (linux-x86_64) (push) Successful in 1m46s
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-QfNC11XQ+qhdsxU6JWiHsvLnhn9xvxKaEPhhDJ2nM0c=";
|
|
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
|