nixpkgs/pkgs/tools/networking/telepresence2/default.nix

66 lines
1.5 KiB
Nix
Raw Normal View History

2023-09-11 14:49:51 +01:00
{ lib
, fetchFromGitHub
, buildGoModule
, fuse
}:
2021-04-10 17:54:43 +01:00
2023-09-11 14:49:51 +01:00
let
fuseftp = buildGoModule rec {
pname = "go-fuseftp";
version = "0.4.2";
src = fetchFromGitHub {
owner = "datawire";
repo = "go-fuseftp";
rev = "v${version}";
hash = "sha256-bkaC+EOqFPQA4fDkVhO6EqgGhOJy31yGwVbbPoRd+70=";
};
vendorHash = "sha256-Dk4wvg2lTGTw8vP42+XuvmMXeMluR0SPwlVHLEB8yCQ=";
buildInputs = [ fuse ];
ldflags = [ "-s" "-w" ];
subPackages = [ "pkg/main" ];
};
in
2021-04-10 17:54:43 +01:00
buildGoModule rec {
pname = "telepresence2";
2023-09-11 14:49:51 +01:00
version = "2.15.1";
2021-04-10 17:54:43 +01:00
src = fetchFromGitHub {
owner = "telepresenceio";
repo = "telepresence";
rev = "v${version}";
2023-09-11 14:49:51 +01:00
hash = "sha256-67a5e7Lun/mlRwRoD6eomQpgUXqzAUx8IS7Mv86j6Gw=";
2021-04-10 17:54:43 +01:00
};
2023-09-11 14:49:51 +01:00
propagatedBuildInputs = [
fuseftp
];
# telepresence depends on fuseftp existing as a built binary, as it gets embedded
# CGO gets disabled to match their build process as that is how it's done upstream
2021-11-04 20:43:27 +00:00
preBuild = ''
2023-09-11 14:49:51 +01:00
cp ${fuseftp}/bin/main ./pkg/client/remotefs/fuseftp.bits
export CGO_ENABLED=0
2021-11-04 20:43:27 +00:00
'';
2023-09-11 14:49:51 +01:00
vendorHash = "sha256-/13OkcLJI/q14tyFsynL5ZAIITH1w9XWpzRqZoJJesE=";
2021-04-10 17:54:43 +01:00
2021-08-26 07:45:51 +01:00
ldflags = [
"-s" "-w" "-X=github.com/telepresenceio/telepresence/v2/pkg/version.Version=${src.rev}"
];
2021-04-10 17:54:43 +01:00
subPackages = [ "cmd/telepresence" ];
meta = with lib; {
description = "Local development against a remote Kubernetes or OpenShift cluster";
homepage = "https://telepresence.io";
2021-04-10 17:54:43 +01:00
license = licenses.asl20;
2023-09-11 14:49:51 +01:00
maintainers = with maintainers; [ mausch vilsol ];
mainProgram = "telepresence";
2021-04-10 17:54:43 +01:00
};
}