2023-08-22 02:31:03 +01:00
|
|
|
{ lib, fetchFromGitHub, buildGoModule, testers, oneshot }:
|
2020-07-09 15:27:23 +01:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "oneshot";
|
2023-08-22 02:31:03 +01:00
|
|
|
version = "2.0.1";
|
2020-07-09 15:27:23 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2023-08-22 02:31:03 +01:00
|
|
|
owner = "forestnode-io";
|
2020-07-09 15:27:23 +01:00
|
|
|
repo = "oneshot";
|
|
|
|
rev = "v${version}";
|
2023-08-22 02:31:03 +01:00
|
|
|
hash = "sha256-QReh8wdFeiCAv+XMz4cADNn9QcxlvewFJJuJ+OH7Lgc=";
|
2020-07-09 15:27:23 +01:00
|
|
|
};
|
|
|
|
|
2023-08-22 02:31:03 +01:00
|
|
|
vendorHash = "sha256-z6eOPugSwWEK02lgRu5Oo8LzjXnJlAtQvkzdevjBTVs=";
|
2020-07-09 15:27:23 +01:00
|
|
|
|
2023-08-22 02:31:03 +01:00
|
|
|
subPackages = [ "cmd" ];
|
2020-08-04 01:26:27 +01:00
|
|
|
|
2023-08-22 02:31:03 +01:00
|
|
|
GOWORK = "off";
|
|
|
|
|
|
|
|
modRoot = "v2";
|
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-extldflags=-static"
|
|
|
|
"-X github.com/forestnode-io/oneshot/v2/pkg/version.Version=${version}"
|
|
|
|
"-X github.com/forestnode-io/oneshot/v2/pkg/version.APIVersion=v1.0.0"
|
|
|
|
];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -D -m 555 -T $GOPATH/bin/cmd $out/bin/oneshot
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = oneshot;
|
|
|
|
command = "oneshot version";
|
|
|
|
};
|
2020-07-09 15:27:23 +01:00
|
|
|
|
|
|
|
meta = with lib; {
|
2023-08-22 02:31:03 +01:00
|
|
|
description = "A first-come first-served single-fire HTTP server";
|
|
|
|
homepage = "https://www.oneshot.uno/";
|
2020-07-09 15:27:23 +01:00
|
|
|
license = licenses.mit;
|
2022-01-04 12:29:54 +00:00
|
|
|
maintainers = with maintainers; [ milibopp ];
|
2023-08-22 02:31:03 +01:00
|
|
|
mainProgram = "oneshot";
|
2020-07-09 15:27:23 +01:00
|
|
|
};
|
|
|
|
}
|