nixpkgs/pkgs/servers/pocketbase/default.nix
2024-06-23 13:29:20 +00:00

46 lines
1009 B
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, nix-update-script
}:
buildGoModule rec {
pname = "pocketbase";
version = "0.22.14";
src = fetchFromGitHub {
owner = "pocketbase";
repo = "pocketbase";
rev = "v${version}";
hash = "sha256-d2gqw3IJBkU2sfBf5J0E45VzFtuSox4cHpPucsl/o4s=";
};
vendorHash = "sha256-G5VD5Joq/p1rur0SmK1xNQxtNZh7ZqR5I4j8fgswoDo=";
# This is the released subpackage from upstream repo
subPackages = [ "examples/base" ];
CGO_ENABLED = 0;
# Upstream build instructions
ldflags = [
"-s"
"-w"
"-X github.com/pocketbase/pocketbase.Version=${version}"
];
postInstall = ''
mv $out/bin/base $out/bin/pocketbase
'';
passthru.updateScript = nix-update-script { };
meta = with lib; {
description = "Open Source realtime backend in 1 file";
homepage = "https://github.com/pocketbase/pocketbase";
license = licenses.mit;
maintainers = with maintainers; [ dit7ya thilobillerbeck ];
mainProgram = "pocketbase";
};
}