2023-07-22 11:20:34 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
2023-08-22 17:36:10 +00:00
|
|
|
, callPackage
|
2023-07-22 11:20:34 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
}:
|
2023-09-24 18:23:54 +00:00
|
|
|
buildGoModule rec {
|
|
|
|
pname = "pgrok";
|
2023-08-22 17:36:10 +00:00
|
|
|
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}";
|
2023-08-22 17:36:10 +00:00
|
|
|
hash = "sha256-2k3XLXmf1Xnx4HvS7sD/aq+78Z4I7uY4djV958n5TX4=";
|
2023-07-22 11:20:34 +00:00
|
|
|
};
|
2023-08-22 17:36:10 +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"
|
|
|
|
];
|
|
|
|
|
2023-08-22 17:36:10 +00:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2023-08-22 17:36:10 +00:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|