Files
jj-cz/nix/make-binary.nix
T
phundrak 3564230dba
Run checks and build archives / build (linux-aarch64) (push) Has been cancelled
Run checks and build archives / build (linux-x86_64) (push) Has been cancelled
Run checks and build archives / build (windows-x86_64) (push) Has been cancelled
Run checks and build archives / coverage-and-sonar (push) Has been cancelled
ci(nix): add archive packages and overhaul CI workflows
2026-05-28 21:23:41 +02:00

28 lines
728 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;
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