Files
nixpkgs/pkgs/by-name/ra/rathole/package.nix
Michael Daniels 3ec4e5c805 rathole: update hash
It was not updated in https://github.com/NixOS/nixpkgs/pull/481598. Oops!
2026-05-19 18:19:13 -04:00

78 lines
1.9 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
rustPlatform,
rustc,
pkg-config,
openssl,
nixosTests,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "rathole";
version = "0.5.0-unstable-2025-07-29";
src = fetchFromGitHub {
owner = "rathole-org";
repo = "rathole";
rev = "5a9dd6d939744859af322aeff7fd60f7483a68bc";
hash = "sha256-jSwqEJcRv2PwBEY7dV20x9d0GjPb/eZ0w7j1e4YlYH8=";
};
# Get rid of git dependency on vergen. No reason to require libgit2-sys as
# well as libz-sys. Vendored c libraries for libgit2/zlib fail to build on
# darwin and using libs from nixpkgs seems excessive.
patches = [
./0001-no-more-vergen.patch
];
# Build script is only needed for vergen and does nothing when not in a git
# repo.
postPatch = ''
rm build.rs
'';
cargoHash = "sha256-IgPDe8kuWzJ6nF2DceUbN7fw0eGkoYhu1IGMdlSMFos=";
nativeBuildInputs = [ pkg-config ];
buildInputs = [
openssl
];
__darwinAllowLocalNetworking = true;
nativeCheckInputs = [ openssl ];
preCheck = ''
patchShebangs examples/tls/create_self_signed_cert.sh
(cd examples/tls && chmod +x create_self_signed_cert.sh && ./create_self_signed_cert.sh)
'';
env = {
VERGEN_BUILD_TIMESTAMP = "0";
VERGEN_BUILD_SEMVER = finalAttrs.version;
VERGEN_GIT_COMMIT_TIMESTAMP = "0";
VERGEN_GIT_BRANCH = "main";
VERGEN_RUSTC_SEMVER = rustc.version;
VERGEN_RUSTC_CHANNEL = "stable";
VERGEN_CARGO_PROFILE = "release";
VERGEN_CARGO_FEATURES = "";
VERGEN_CARGO_TARGET_TRIPLE = "${stdenv.hostPlatform.rust.rustcTarget}";
};
passthru.tests = {
inherit (nixosTests) rathole;
};
meta = {
description = "Reverse proxy for NAT traversal";
homepage = "https://github.com/rathole-org/rathole";
license = lib.licenses.asl20;
mainProgram = "rathole";
maintainers = with lib.maintainers; [
xokdvium
];
};
})