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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

56 lines
1.1 KiB
Nix
Raw Normal View History

2023-07-22 11:20:34 +00:00
{ lib
, buildGoModule
, callPackage
2023-07-22 11:20:34 +00:00
, fetchFromGitHub
}:
2023-09-24 18:23:54 +00:00
buildGoModule rec {
pname = "pgrok";
version = "1.4.0";
2023-09-24 18:23:54 +00:00
2023-07-22 11:20:34 +00:00
src = fetchFromGitHub {
owner = "pgrok";
repo = "pgrok";
rev = "v${version}";
hash = "sha256-2k3XLXmf1Xnx4HvS7sD/aq+78Z4I7uY4djV958n5TX4=";
2023-07-22 11:20:34 +00:00
};
vendorHash = "sha256-M0xVHRh9NKPxmUEmx1dDQUZc8aXcdAfHisQAnt72RdY=";
2023-07-22 11:20:34 +00:00
2023-09-24 18:23:54 +00:00
outputs = [ "out" "server" ];
web = callPackage ./web.nix { inherit src version; };
2023-07-22 11:20:34 +00:00
ldflags = [
"-s"
"-w"
"-X main.version=${version}"
"-X main.commit=unknown"
"-X main.date=unknown"
];
subPackages = [
"pgrok/pgrok"
"pgrokd/pgrokd"
];
postPatch = ''
# rename packages due to naming conflict
mv pgrok/cli/ pgrok/pgrok/
mv pgrokd/cli/ pgrokd/pgrokd/
cp -r ${web} pgrokd/pgrokd/dist
'';
2023-07-22 11:20:34 +00:00
postInstall = ''
moveToOutput bin/pgrokd $server
'';
passthru.updateScript = ./update.sh;
2023-07-22 11:20:34 +00:00
meta = {
description = "Selfhosted TCP/HTTP tunnel, ngrok alternative, written in Go";
homepage = "https://github.com/pgrok/pgrok";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ marie ];
};
}