diff options
Diffstat (limited to 'nixpkgs/pkgs/servers/pocketbase/default.nix')
-rw-r--r-- | nixpkgs/pkgs/servers/pocketbase/default.nix | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/pocketbase/default.nix b/nixpkgs/pkgs/servers/pocketbase/default.nix new file mode 100644 index 000000000000..adf259c4a4a0 --- /dev/null +++ b/nixpkgs/pkgs/servers/pocketbase/default.nix @@ -0,0 +1,45 @@ +{ lib +, buildGoModule +, fetchFromGitHub +, nix-update-script +}: + +buildGoModule rec { + pname = "pocketbase"; + version = "0.22.6"; + + src = fetchFromGitHub { + owner = "pocketbase"; + repo = "pocketbase"; + rev = "v${version}"; + hash = "sha256-TbbfTPLV5R/XfKBxvjico2119iXJTh/9Grc9QfzeTDo="; + }; + + vendorHash = "sha256-RSeYA8cmwj5OzgXBgU2zuOTwmEofmm3YRDSc/bKGBGk="; + + # 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"; + }; +} |