{ pkgs , crane , buildTarget ? "x86_64-unknown-linux-musl" }: let craneLib = (crane.mkLib pkgs).overrideToolchain pkgs.rustToolchain; nativeBuildInputs = [ pkgs.protobuf ]; src = pkgs.lib.cleanSourceWith { src = craneLib.path ../.; filter = path: type: (craneLib.filterCargoSources path type) || (builtins.match ".*proto$" path != null); }; in craneLib.buildPackage { inherit src nativeBuildInputs; pname = "prymn_agent"; version = "0.1.0"; doCheck = false; # FIXME: Tests need to run on the native architecture strictDeps = true; CARGO_BUILD_RUSTFLAGS = "-C target-feature=+crt-static -C linker=rust-lld"; CARGO_BUILD_TARGET = buildTarget; }