Skip to content

Commit c79c52d

Browse files
pgx_ulid: init at 0.2.0 (#371463)
2 parents f4b45ea + 5d524ce commit c79c52d

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

pkgs/servers/sql/postgresql/ext/default.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ in {
9393

9494
pgrouting = super.callPackage ./pgrouting.nix { };
9595

96+
pgx_ulid = super.callPackage ./pgx_ulid.nix { };
97+
9698
pg_partman = super.callPackage ./pg_partman.nix { };
9799

98100
pg_relusage = super.callPackage ./pg_relusage.nix { };
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
lib,
3+
buildPgrxExtension,
4+
fetchFromGitHub,
5+
nix-update-script,
6+
postgresql,
7+
util-linux,
8+
}:
9+
buildPgrxExtension rec {
10+
inherit postgresql;
11+
12+
pname = "pgx_ulid";
13+
version = "0.2.0";
14+
15+
src = fetchFromGitHub {
16+
owner = "pksunkara";
17+
repo = "pgx_ulid";
18+
tag = "v${version}";
19+
hash = "sha256-VdLWwkUA0sVs5Z/Lyf5oTRhcHVzPmhgnYQhIM8MWJ0c=";
20+
};
21+
22+
cargoHash = "sha256-Gn+SjzGaxnGKJYI9+WyE1+TzlF/2Ne43aKbXrSzfQKM=";
23+
24+
postInstall = ''
25+
# Upstream renames the extension when packaging
26+
# https://github.com/pksunkara/pgx_ulid/blob/084778c3e2af08d16ec5ec3ef4e8f345ba0daa33/.github/workflows/release.yml#L81
27+
# Upgrade scripts should be added later, so we also rename them with wildcard
28+
# https://github.com/pksunkara/pgx_ulid/issues/49
29+
${util-linux}/bin/rename pgx_ulid ulid $out/share/postgresql/extension/pgx_ulid*
30+
'';
31+
32+
# pgrx tests try to install the extension into postgresql nix store
33+
doCheck = false;
34+
35+
passthru = {
36+
updateScript = nix-update-script { };
37+
};
38+
39+
meta = {
40+
# Support for PostgreSQL 13 was removed in 0.2.0: https://github.com/pksunkara/pgx_ulid/blob/084778c3e2af08d16ec5ec3ef4e8f345ba0daa33/CHANGELOG.md?plain=1#L6
41+
broken = lib.versionOlder postgresql.version "14";
42+
description = "ULID Postgres extension written in Rust";
43+
homepage = "https://github.com/pksunkara/pgx_ulid";
44+
changelog = "https://github.com/pksunkara/pgx_ulid/blob/v${version}/CHANGELOG.md";
45+
license = lib.licenses.mit;
46+
maintainers = with lib.maintainers; [ myypo ];
47+
};
48+
}

0 commit comments

Comments
 (0)