nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 buildPgrxExtension,
3 cargo-pgrx_0_16_1,
4 fetchFromGitHub,
5 lib,
6 nix-update-script,
7 postgresql,
8 util-linux,
9}:
10buildPgrxExtension (finalAttrs: {
11 inherit postgresql;
12 cargo-pgrx = cargo-pgrx_0_16_1;
13
14 pname = "pgx_ulid";
15 version = "0.2.2";
16
17 src = fetchFromGitHub {
18 owner = "pksunkara";
19 repo = "pgx_ulid";
20 tag = "v${finalAttrs.version}";
21 hash = "sha256-7zOAjQPdwaDwAz2Es5KX3HstTwY6wKNuB9b+xnnXNP0=";
22 };
23
24 cargoHash = "sha256-4YuTOCE142BDDteB9ZQdxzI8EUXN+jRZfy1eq64qHtg=";
25
26 postInstall = ''
27 # Upstream renames the extension when packaging as well as upgrade scripts
28 # https://github.com/pksunkara/pgx_ulid/blob/master/.github/workflows/release.yml#L80
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${finalAttrs.version}/CHANGELOG.md";
45 license = lib.licenses.mit;
46 maintainers = with lib.maintainers; [
47 myypo
48 typedrat
49 ];
50 };
51})