ci(nix): add archive packages and overhaul CI workflows
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
{
|
||||
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
|
||||
Reference in New Issue
Block a user