Files
nixpkgs/pkgs/by-name/ca/cargo-lambda/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

81 lines
1.9 KiB
Nix

{
lib,
cacert,
curl,
rustPlatform,
fetchFromGitHub,
makeWrapper,
pkg-config,
openssl,
stdenv,
zig_0_13,
nix-update-script,
}:
rustPlatform.buildRustPackage rec {
pname = "cargo-lambda";
version = "1.8.6";
src = fetchFromGitHub {
owner = "cargo-lambda";
repo = "cargo-lambda";
tag = "v${version}";
hash = "sha256-ocFD2FK1nlEJ8xXhDSxpSKYU8oZk/QwfojveypVt1GU=";
};
cargoHash = "sha256-yE0pr7RZb015d51QtwVNfqXd8yEETvDdKJ5M7Oqc4Ds=";
nativeCheckInputs = [ cacert ];
nativeBuildInputs = [
makeWrapper
pkg-config
];
buildInputs = [
openssl
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
curl
];
# Remove files that don't make builds reproducible:
# - Remove build.rs file that adds the build date to the version.
# - Remove cargo_lambda.rs that contains tests that reach the network.
postPatch = ''
rm crates/cargo-lambda-cli/build.rs
rm crates/cargo-lambda-cli/tests/cargo_lambda.rs
'';
postInstall = ''
wrapProgram $out/bin/cargo-lambda --prefix PATH : ${lib.makeBinPath [ zig_0_13 ]}
'';
CARGO_LAMBDA_BUILD_INFO = "(nixpkgs)";
cargoBuildFlags = [ "--features=skip-build-banner" ];
cargoCheckFlags = [ "--features=skip-build-banner" ];
checkFlags = lib.optionals stdenv.hostPlatform.isDarwin [
# Fails in darwin sandbox, first because of trying to listen to a port on
# localhost. While this would be fixed by `__darwinAllowLocalNetworking = true;`,
# they then fail with other I/O issues.
"--skip=test::test_download_example"
"--skip=test::test_download_example_with_cache"
];
passthru.updateScript = nix-update-script { };
meta = {
description = "Cargo subcommand to help you work with AWS Lambda";
mainProgram = "cargo-lambda";
homepage = "https://cargo-lambda.info";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
taylor1791
calavera
matthiasbeyer
];
};
}