nixpkgs/pkgs/by-name/te/telepresence2/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

66 lines
1.5 KiB
Nix

{ lib
, fetchFromGitHub
, buildGoModule
, fuse
}:
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
buildGoModule rec {
pname = "telepresence2";
version = "2.20.2";
src = fetchFromGitHub {
owner = "telepresenceio";
repo = "telepresence";
rev = "v${version}";
hash = "sha256-MwAet+UJ6BNEj6/NYN9HBxTGbw2CS2ASUJQrKtpoV1I=";
};
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
preBuild = ''
cp ${fuseftp}/bin/main ./pkg/client/remotefs/fuseftp.bits
export CGO_ENABLED=0
'';
vendorHash = "sha256-i9quHeAb8PCG1KQGKaOkxTxjImiuK6oMJcRI443/mkI=";
ldflags = [
"-s" "-w" "-X=github.com/telepresenceio/telepresence/v2/pkg/version.Version=${src.rev}"
];
subPackages = [ "cmd/telepresence" ];
meta = with lib; {
description = "Local development against a remote Kubernetes or OpenShift cluster";
homepage = "https://telepresence.io";
license = licenses.asl20;
maintainers = with maintainers; [ mausch vilsol ];
mainProgram = "telepresence";
};
}