nixpkgs/pkgs/applications/networking/cloudflared/default.nix
superherointj db6a3b620a
cloudflared: 2022.4.0 -> 2022.4.1 + fix tests for linux (#167419)
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2022-04-13 12:13:11 +02:00

39 lines
1.1 KiB
Nix

{ lib, buildGoModule, fetchFromGitHub, stdenv }:
buildGoModule rec {
pname = "cloudflared";
version = "2022.4.1";
src = fetchFromGitHub {
owner = "cloudflare";
repo = "cloudflared";
rev = version;
hash = "sha256-dgvXbWtLP6sXBlqcx/xpw9LIbcE4VlYZQO5rrS34+9I=";
};
vendorSha256 = null;
ldflags = [ "-X main.Version=${version}" ];
preCheck = ''
# Workaround for: sshgen_test.go:74: mkdir /homeless-shelter/.cloudflared: no such file or directory
export HOME="$(mktemp -d)";
# Workaround for: protocol_test.go:11:
# lookup protocol-v2.argotunnel.com on [::1]:53: read udp [::1]:51876->[::1]:53: read: connection refused
substituteInPlace "edgediscovery/protocol_test.go" \
--replace "TestProtocolPercentage" "SkipProtocolPercentage"
'';
doCheck = !stdenv.isDarwin;
meta = with lib; {
description = "CloudFlare Tunnel daemon (and DNS-over-HTTPS client)";
homepage = "https://www.cloudflare.com/products/tunnel";
license = licenses.asl20;
platforms = platforms.unix;
maintainers = with maintainers; [ bbigras enorris thoughtpolice techknowlogick ];
};
}