From 6ed2406d0c8ed9928c3d3ee8e8e4551794aad479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Mon, 7 Jul 2025 21:16:39 +0200 Subject: [PATCH 1/9] chore: update (and refactor) flake inputs --- flake.lock | 226 ++++++++++++----------------------------------------- flake.nix | 38 ++++++--- 2 files changed, 76 insertions(+), 188 deletions(-) diff --git a/flake.lock b/flake.lock index 8b6d868bf..80aa4c911 100644 --- a/flake.lock +++ b/flake.lock @@ -21,32 +21,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1749398372, - "narHash": "sha256-tYBdgS56eXYaWVW3fsnPQ/nFlgWi/Z2Ymhyu21zVM98=", + "lastModified": 1751413152, + "narHash": "sha256-Tyw1RjYEsp5scoigs1384gIg6e0GoBVjms4aXFfRssQ=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "9305fe4e5c2a6fcf5ba6a3ff155720fbe4076569", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "flake-parts_2": { - "inputs": { - "nixpkgs-lib": [ - "nix-fast-build", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1749398372, - "narHash": "sha256-tYBdgS56eXYaWVW3fsnPQ/nFlgWi/Z2Ymhyu21zVM98=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "9305fe4e5c2a6fcf5ba6a3ff155720fbe4076569", + "rev": "77826244401ea9de6e3bac47c2db46005e1f30b5", "type": "github" }, "original": { @@ -60,29 +39,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1705309234, - "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_2": { - "inputs": { - "systems": "systems_2" - }, - "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -136,7 +97,9 @@ }, "nix-editor": { "inputs": { - "nixpkgs": "nixpkgs", + "nixpkgs": [ + "nixpkgs" + ], "utils": "utils" }, "locked": { @@ -155,16 +118,22 @@ }, "nix-fast-build": { "inputs": { - "flake-parts": "flake-parts_2", - "nixpkgs": "nixpkgs_2", - "treefmt-nix": "treefmt-nix" + "flake-parts": [ + "flake-parts" + ], + "nixpkgs": [ + "nixpkgs" + ], + "treefmt-nix": [ + "treefmt-nix" + ] }, "locked": { - "lastModified": 1749427739, - "narHash": "sha256-Nm0oMqFNRnJsiZYeNChmefmjeVCOzngikpSQhgs7iXI=", + "lastModified": 1752057525, + "narHash": "sha256-AVjuld7/5LTmvnTGtVCAoTUlDzooThpOsj8sxtm6d8o=", "owner": "Mic92", "repo": "nix-fast-build", - "rev": "b1dae483ab7d4139a6297e02b6de9e5d30e43d48", + "rev": "9766395106a9c1f8d4797934d106e02f1787c7bc", "type": "github" }, "original": { @@ -175,15 +144,16 @@ }, "nix2container": { "inputs": { - "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_3" + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { - "lastModified": 1708764364, - "narHash": "sha256-+pOtDvmuVTg0Gi58hKDUyrNla5NbyUvt3Xs3gLR0Fws=", + "lastModified": 1752002763, + "narHash": "sha256-JYAkdZvpdSx9GUoHPArctYMypSONob4DYKRkOubUWtY=", "owner": "nlewo", "repo": "nix2container", - "rev": "c891f90d2e3c48a6b33466c96e4851e0fc0cf455", + "rev": "4f2437f6a1844b843b380d483087ae6d461240ee", "type": "github" }, "original": { @@ -194,27 +164,24 @@ }, "nixpkgs": { "locked": { - "lastModified": 1675673983, - "narHash": "sha256-8hzNh1jtiPxL5r3ICNzSmpSzV7kGb3KwX+FS5BWJUTo=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "5a350a8f31bb7ef0c6e79aea3795a890cf7743d4", - "type": "github" + "lastModified": 1752076035, + "narHash": "sha256-ROMKbpfgrbogAWXNXJxUu+BoPyZdOq/MQ3UNYVP863o=", + "rev": "9807714d6944a957c2e036f84b0ff8caf9930bc0", + "type": "tarball", + "url": "https://releases.nixos.org/nixos/unstable/nixos-25.11pre826938.9807714d6944/nixexprs.tar.xz?rev=9807714d6944a957c2e036f84b0ff8caf9930bc0" }, "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" + "type": "tarball", + "url": "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz" } }, "nixpkgs-lib": { "locked": { - "lastModified": 1750555020, - "narHash": "sha256-/MjivcZIz8dyLOTFdJzS5Yazt2QCePQBh8uZooODaYw=", + "lastModified": 1751159883, + "narHash": "sha256-urW/Ylk9FIfvXfliA1ywh75yszAbiTEVgpPeinFyVZo=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "6fb7349157ee1bffd053b1fdd454aa74ff7b4aee", + "rev": "14a40a1d7fb9afa4739275ac642ed7301a9ba1ab", "type": "github" }, "original": { @@ -223,69 +190,6 @@ "type": "github" } }, - "nixpkgs_2": { - "locked": { - "lastModified": 1749411262, - "narHash": "sha256-gRBkeW9l5lb/90lv1waQFNT+18OhITs11HENarh6vNo=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "0fc422d6c394191338c9d6a05786c63fc52a0f29", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable-small", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { - "locked": { - "lastModified": 1697269602, - "narHash": "sha256-dSzV7Ud+JH4DPVD9od53EgDrxUVQOcSj4KGjggCDVJI=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "9cb540e9c1910d74a7e10736277f6eb9dff51c81", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_4": { - "locked": { - "lastModified": 1712666087, - "narHash": "sha256-WwjUkWsjlU8iUImbivlYxNyMB1L5YVqE8QotQdL9jWc=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "a76c4553d7e741e17f289224eda135423de0491d", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_5": { - "locked": { - "lastModified": 1744536153, - "narHash": "sha256-awS2zRgF4uTwrOKwwiJcByDzDOdo3Q1rPZbiHQg/N38=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "18dd725c29603f582cf1900e0d25f9f1063dbf11", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "root": { "inputs": { "flake-parts": "flake-parts", @@ -294,21 +198,23 @@ "nix-editor": "nix-editor", "nix-fast-build": "nix-fast-build", "nix2container": "nix2container", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs", "rust-overlay": "rust-overlay", - "treefmt-nix": "treefmt-nix_2" + "treefmt-nix": "treefmt-nix" } }, "rust-overlay": { "inputs": { - "nixpkgs": "nixpkgs_5" + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { - "lastModified": 1749609482, - "narHash": "sha256-R+Y3tXIUAMosrgo/ynhIUPEONZ+cM0ScbgN7KA8OkoE=", + "lastModified": 1752201818, + "narHash": "sha256-d8KczaVT8WFEZdWg//tMAbv8EDyn2YTWcJvSY8gqKBU=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "a17da8deb943e7c8b4151914abbfe33d5a4e5b0d", + "rev": "bd8f8329780b348fedcd37b53dbbee48c08c496d", "type": "github" }, "original": { @@ -332,54 +238,18 @@ "type": "github" } }, - "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "treefmt-nix": { - "inputs": { - "nixpkgs": [ - "nix-fast-build", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1749194973, - "narHash": "sha256-eEy8cuS0mZ2j/r/FE0/LYBSBcIs/MKOIVakwHVuqTfk=", - "owner": "numtide", - "repo": "treefmt-nix", - "rev": "a05be418a1af1198ca0f63facb13c985db4cb3c5", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "treefmt-nix", - "type": "github" - } - }, - "treefmt-nix_2": { "inputs": { "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1750931469, - "narHash": "sha256-0IEdQB1nS+uViQw4k3VGUXntjkDp7aAlqcxdewb/hAc=", + "lastModified": 1752055615, + "narHash": "sha256-19m7P4O/Aw/6+CzncWMAJu89JaKeMh3aMle1CNQSIwM=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "ac8e6f32e11e9c7f153823abc3ab007f2a65d3e1", + "rev": "c9d477b5d5bd7f26adddd3f96cfd6a904768d4f9", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 3aa651b09..1039aecea 100644 --- a/flake.nix +++ b/flake.nix @@ -2,17 +2,35 @@ description = "Prototype tooling for deploying PostgreSQL"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; - flake-utils.url = "github:numtide/flake-utils"; - nix2container.url = "github:nlewo/nix2container"; - nix-editor.url = "github:snowfallorg/nix-editor"; - rust-overlay.url = "github:oxalica/rust-overlay"; - nix-fast-build.url = "github:Mic92/nix-fast-build"; + nixpkgs.url = "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz"; flake-parts.url = "github:hercules-ci/flake-parts"; - treefmt-nix.url = "github:numtide/treefmt-nix"; - treefmt-nix.inputs.nixpkgs.follows = "nixpkgs"; - git-hooks.url = "github:cachix/git-hooks.nix"; - git-hooks.inputs.nixpkgs.follows = "nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + treefmt-nix = { + url = "github:numtide/treefmt-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nix-editor = { + url = "github:snowfallorg/nix-editor"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nix-fast-build = { + url = "github:Mic92/nix-fast-build"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.flake-parts.follows = "flake-parts"; + inputs.treefmt-nix.follows = "treefmt-nix"; + }; + nix2container = { + url = "github:nlewo/nix2container"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + rust-overlay = { + url = "github:oxalica/rust-overlay"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + git-hooks = { + url = "github:cachix/git-hooks.nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = From 8ec188f46f813f5216bb954f68efac447d54c475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Mon, 7 Jul 2025 21:17:11 +0200 Subject: [PATCH 2/9] chore: replace (deprecated) `substituteAll` by `replaceVars` --- nix/postgresql/generic.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/nix/postgresql/generic.nix b/nix/postgresql/generic.nix index d922895fa..d3e2de15f 100644 --- a/nix/postgresql/generic.nix +++ b/nix/postgresql/generic.nix @@ -21,7 +21,7 @@ let libxml2, tzdata, libkrb5, - substituteAll, + replaceVars, darwin, linux-pam, #orioledb specific @@ -188,8 +188,7 @@ let ./patches/specify_pkglibdir_at_runtime.patch ./patches/paths-with-postgresql-suffix.patch - (substituteAll { - src = ./patches/locale-binary-path.patch; + (replaceVars ./patches/locale-binary-path.patch { locale = "${if stdenv.isDarwin then darwin.adv_cmds else lib.getBin stdenv.cc.libc}/bin/locale"; }) ] From 9bb7d52a018107c3bedd331e0e8507a861b8dc02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Mon, 7 Jul 2025 21:18:12 +0200 Subject: [PATCH 3/9] chore: fix missing required `teams` meta attribute --- nix/postgresql/generic.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nix/postgresql/generic.nix b/nix/postgresql/generic.nix index d3e2de15f..2f3a2c050 100644 --- a/nix/postgresql/generic.nix +++ b/nix/postgresql/generic.nix @@ -331,6 +331,7 @@ let description = "Powerful, open source object-relational database system"; license = licenses.postgresql; changelog = "https://www.postgresql.org/docs/release/${finalAttrs.version}/"; + teams = [ ]; maintainers = with maintainers; [ thoughtpolice danbst From 5b73ce6d7c9f32454c548aa3d477ab196a2f8276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Mon, 7 Jul 2025 21:19:07 +0200 Subject: [PATCH 4/9] chore: update old (unsupported) version of nix used in script --- nix/packages/sync-exts-versions.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nix/packages/sync-exts-versions.nix b/nix/packages/sync-exts-versions.nix index d76e66553..02fa3deaa 100644 --- a/nix/packages/sync-exts-versions.nix +++ b/nix/packages/sync-exts-versions.nix @@ -11,7 +11,7 @@ runCommand "sync-exts-versions" { } '' --subst-var-by 'YQ' '${yq}/bin/yq' \ --subst-var-by 'JQ' '${jq}/bin/jq' \ --subst-var-by 'NIX_EDITOR' '${nix-editor.packages.nix-editor}/bin/nix-editor' \ - --subst-var-by 'NIXPREFETCHURL' '${nixVersions.nix_2_20}/bin/nix-prefetch-url' \ - --subst-var-by 'NIX' '${nixVersions.nix_2_20}/bin/nix' + --subst-var-by 'NIXPREFETCHURL' '${nixVersions.nix_2_29}/bin/nix-prefetch-url' \ + --subst-var-by 'NIX' '${nixVersions.nix_2_29}/bin/nix' chmod +x $out/bin/sync-exts-versions '' From 17f2209b1bfdaebc45e6ba845d4e1cc90d577acb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Mon, 7 Jul 2025 21:19:50 +0200 Subject: [PATCH 5/9] fix: overlay and use our `buildPgrxExtension` function These overlay packages will be removed once the extensions are updated to use the new `buildPgrxExtension` function. --- nix/cargo-pgrx/default.nix | 6 +++--- nix/overlays/default.nix | 11 +++++------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/nix/cargo-pgrx/default.nix b/nix/cargo-pgrx/default.nix index 6d9ef2a1a..5017a05d8 100644 --- a/nix/cargo-pgrx/default.nix +++ b/nix/cargo-pgrx/default.nix @@ -65,17 +65,17 @@ in cargo-pgrx_0_12_6 = mkCargoPgrx { version = "0.12.6"; hash = "sha256-7aQkrApALZe6EoQGVShGBj0UIATnfOy2DytFj9IWdEA="; - cargoHash = "sha256-Di4UldQwAt3xVyvgQT1gUhdvYUVp7n/a72pnX45kP0w="; + cargoHash = "sha256-pnMxWWfvr1/AEp8DvG4awig8zjdHizJHoZ5RJA8CL08="; }; cargo-pgrx_0_12_9 = mkCargoPgrx { version = "0.12.9"; hash = "sha256-aR3DZAjeEEAjLQfZ0ZxkjLqTVMIEbU0UiZ62T4BkQq8="; - cargoHash = "sha256-KTKcol9qSNLQZGW32e6fBb6cPkUGItknyVpLdBYqrBY="; + cargoHash = "sha256-yZpD3FriL9UbzRtdFkfIfFfYIrRPYxr/lZ5rb0YBTPc="; }; cargo-pgrx_0_14_3 = mkCargoPgrx { version = "0.14.3"; hash = "sha256-3TsNpEqNm3Uol5XPW1i0XEbP2fF2+RKB2d7lO6BDnvQ="; - cargoHash = "sha256-Ny7j56pwB+2eEK62X0nWfFKQy5fBz+Q1oyvecivxLkk="; + cargoHash = "sha256-LZUXhjMxkBs3O5feH4X5NQC7Qk4Ja6M5+sAYaSCikrY="; }; inherit mkCargoPgrx; } diff --git a/nix/overlays/default.nix b/nix/overlays/default.nix index f6eda4243..4d6ca5bb6 100644 --- a/nix/overlays/default.nix +++ b/nix/overlays/default.nix @@ -1,6 +1,6 @@ { self, ... }: { - flake.overlays.default = final: prev: { + flake.overlays.default = final: _prev: { # NOTE: add any needed overlays here. in theory we could # pull them from the overlays/ directory automatically, but we don't # want to have an arbitrary order, since it might matter. being @@ -31,24 +31,23 @@ inherit (final) lib; inherit (final) Security; inherit (final) pkg-config; - inherit (final) makeRustPlatform; inherit (final) stdenv; inherit (final) writeShellScriptBin; }; - buildPgrxExtension_0_11_3 = prev.buildPgrxExtension.override { + buildPgrxExtension_0_11_3 = final.buildPgrxExtension.override { cargo-pgrx = final.cargo-pgrx.cargo-pgrx_0_11_3; }; - buildPgrxExtension_0_12_6 = prev.buildPgrxExtension.override { + buildPgrxExtension_0_12_6 = final.buildPgrxExtension.override { cargo-pgrx = final.cargo-pgrx.cargo-pgrx_0_12_6; }; - buildPgrxExtension_0_12_9 = prev.buildPgrxExtension.override { + buildPgrxExtension_0_12_9 = final.buildPgrxExtension.override { cargo-pgrx = final.cargo-pgrx.cargo-pgrx_0_12_9; }; - buildPgrxExtension_0_14_3 = prev.buildPgrxExtension.override { + buildPgrxExtension_0_14_3 = final.buildPgrxExtension.override { cargo-pgrx = final.cargo-pgrx.cargo-pgrx_0_14_3; }; }; From e12fc13ed26ddf561425b8c35f350125b031c9ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Mon, 7 Jul 2025 21:20:42 +0200 Subject: [PATCH 6/9] chore: `v8` has been removed from nixpkgs and replaced with `nodejs.libv8` --- nix/ext/plv8.nix | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/nix/ext/plv8.nix b/nix/ext/plv8.nix index 9eaa40459..d2cd1ae4d 100644 --- a/nix/ext/plv8.nix +++ b/nix/ext/plv8.nix @@ -2,12 +2,12 @@ stdenv, lib, fetchFromGitHub, - v8, + nodejs, perl, postgresql, # For passthru test on various systems, and local development on macos # not we are not currently using passthru tests but retaining for possible contrib - # to nixpkgs + # to nixpkgs clang, xcbuild, darwin, @@ -40,7 +40,7 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ - v8 + nodejs.libv8 postgresql ] ++ lib.optionals stdenv.isDarwin [ @@ -54,20 +54,20 @@ stdenv.mkDerivation (finalAttrs: { [ # Nixpkgs build a v8 monolith instead of separate v8_libplatform. "USE_SYSTEM_V8=1" - "V8_OUTDIR=${v8}/lib" + "V8_OUTDIR=${nodejs.libv8}/lib" "PG_CONFIG=${postgresql}/bin/pg_config" ] ++ lib.optionals stdenv.isDarwin [ "CC=${clang}/bin/clang" "CXX=${clang}/bin/clang++" - "SHLIB_LINK=-L${v8}/lib -lv8_monolith -Wl,-rpath,${v8}/lib" + "SHLIB_LINK=-L${nodejs.libv8}/lib -lv8_monolith -Wl,-rpath,${nodejs.libv8}/lib" ] ++ lib.optionals (!stdenv.isDarwin) [ "SHLIB_LINK=-lv8" ]; NIX_LDFLAGS = ( lib.optionals stdenv.isDarwin [ "-L${postgresql}/lib" - "-L${v8}/lib" + "-L${nodejs.libv8}/lib" "-lv8_monolith" "-lpq" "-lpgcommon" @@ -119,30 +119,26 @@ stdenv.mkDerivation (finalAttrs: { sed -i 's|module_pathname = '"'"'$libdir/plv8-[0-9.]*'"'"'|module_pathname = '"'"'$libdir/plv8'"'"'|' "$out/share/postgresql/extension/plls.control" ${lib.optionalString stdenv.isDarwin '' - install_name_tool -add_rpath "${v8}/lib" $out/lib/plv8.so + install_name_tool -add_rpath "${nodejs.libv8}/lib" $out/lib/plv8.so install_name_tool -add_rpath "${postgresql}/lib" $out/lib/plv8.so install_name_tool -add_rpath "${stdenv.cc.cc.lib}/lib" $out/lib/plv8.so - install_name_tool -change @rpath/libv8_monolith.dylib ${v8}/lib/libv8_monolith.dylib $out/lib/plv8.so + install_name_tool -change @rpath/libv8_monolith.dylib ${nodejs.libv8}/lib/libv8_monolith.dylib $out/lib/plv8.so ''} - ${ - lib.optionalString (!stdenv.isDarwin) '' - ${patchelf}/bin/patchelf --set-rpath "${v8}/lib:${postgresql}/lib:${stdenv.cc.cc.lib}/lib" $out/lib/plv8.so - '' - } + ${lib.optionalString (!stdenv.isDarwin) '' + ${patchelf}/bin/patchelf --set-rpath "${nodejs.libv8}/lib:${postgresql}/lib:${stdenv.cc.cc.lib}/lib" $out/lib/plv8.so + ''} else ${lib.optionalString stdenv.isDarwin '' - install_name_tool -add_rpath "${v8}/lib" $out/lib/plv8-${finalAttrs.version}${postgresql.dlSuffix} + install_name_tool -add_rpath "${nodejs.libv8}/lib" $out/lib/plv8-${finalAttrs.version}${postgresql.dlSuffix} install_name_tool -add_rpath "${postgresql}/lib" $out/lib/plv8-${finalAttrs.version}${postgresql.dlSuffix} install_name_tool -add_rpath "${stdenv.cc.cc.lib}/lib" $out/lib/plv8-${finalAttrs.version}${postgresql.dlSuffix} - install_name_tool -change @rpath/libv8_monolith.dylib ${v8}/lib/libv8_monolith.dylib $out/lib/plv8-${finalAttrs.version}${postgresql.dlSuffix} + install_name_tool -change @rpath/libv8_monolith.dylib ${nodejs.libv8}/lib/libv8_monolith.dylib $out/lib/plv8-${finalAttrs.version}${postgresql.dlSuffix} ''} - ${ - lib.optionalString (!stdenv.isDarwin) '' - ${patchelf}/bin/patchelf --set-rpath "${v8}/lib:${postgresql}/lib:${stdenv.cc.cc.lib}/lib" $out/lib/plv8-${finalAttrs.version}${postgresql.dlSuffix} - '' - } + ${lib.optionalString (!stdenv.isDarwin) '' + ${patchelf}/bin/patchelf --set-rpath "${nodejs.libv8}/lib:${postgresql}/lib:${stdenv.cc.cc.lib}/lib" $out/lib/plv8-${finalAttrs.version}${postgresql.dlSuffix} + ''} fi ''; From ba354b921e32b0a88381d5f920757d38974f6a83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Mon, 7 Jul 2025 21:22:47 +0200 Subject: [PATCH 7/9] chore: fix formatting --- nix/packages/lib.nix | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/nix/packages/lib.nix b/nix/packages/lib.nix index 971909162..b274c5bd9 100644 --- a/nix/packages/lib.nix +++ b/nix/packages/lib.nix @@ -125,13 +125,11 @@ chmod 644 $out/etc/postgresql/pg_hba.conf substitute ${../tools/run-server.sh.in} $out/bin/start-postgres-server \ - ${ - builtins.concatStringsSep " " ( - builtins.attrValues ( - builtins.mapAttrs (name: value: "--subst-var-by '${name}' '${value}'") substitutions - ) + ${builtins.concatStringsSep " " ( + builtins.attrValues ( + builtins.mapAttrs (name: value: "--subst-var-by '${name}' '${value}'") substitutions ) - } + )} chmod +x $out/bin/start-postgres-server ''; } From d155848971c411f89a2c4df1a412e996c6e608da Mon Sep 17 00:00:00 2001 From: Yvan Sraka Date: Fri, 11 Jul 2025 18:17:15 +0200 Subject: [PATCH 8/9] chore: fix a warning about `overrideAttrs` usage trace: evaluation warning: packer-1.13.1 was overridden with `version` but not `src` at /nix/store/y2ddpvhfvv5pshcrj0jckgz36fm9n3c6-source/nix/devShells.nix:49:17. This is most likely not what you want. In order to properly change the version of a package, override both the `version` and `src` attributes: hello.overrideAttrs (oldAttrs: rec { version = "1.0.0"; src = pkgs.fetchurl { url = "mirror://gnu/hello/hello-${version}.tar.gz"; hash = "..."; }; }) (To silence this warning, set `__intentionallyOverridingVersion = true` in your `overrideAttrs` call.) --- nix/devShells.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nix/devShells.nix b/nix/devShells.nix index 7ff4d0720..6d5b5611c 100644 --- a/nix/devShells.nix +++ b/nix/devShells.nix @@ -47,6 +47,7 @@ ansible-lint (packer.overrideAttrs (_oldAttrs: { version = "1.7.8"; + __intentionallyOverridingVersion = true; })) self'.packages.start-server From e1db6d582121d07c19a63af72004ef2f2a51bcc1 Mon Sep 17 00:00:00 2001 From: Yvan Sraka Date: Fri, 11 Jul 2025 19:12:21 +0200 Subject: [PATCH 9/9] chore: bump `pgrouting` version to 3.8.0 The previously used version was failing to build: /build/source/src/common/get_check_data.c: In function 'pgr_SPI_getText': /build/source/src/common/get_check_data.c:307:28: error: passing argument 1 of 'DatumGetCString' makes integer from pointer without a cast [-Wint-conversion] 307 | return DatumGetCString(SPI_getvalue(*tuple, *tupdesc, info.colNumber)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | char * In file included from /build/source/include/c_common/postgres_connection.h:29, from /build/source/src/common/get_check_data.c:27: /nix/store/nn6vpjqlsxxmynwcrsib9agb3hpr5cqj-postgresql-17.4/include/server/postgres.h:335:23: note: expected 'Datum' {aka 'long unsigned int'} but argument is of type 'char *' 335 | DatumGetCString(Datum X) | ~~~~~~^ make[2]: *** [src/common/CMakeFiles/common.dir/build.make:149: src/common/CMakeFiles/common.dir/get_check_data.c.o] Error 1 --- nix/ext/pgrouting.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nix/ext/pgrouting.nix b/nix/ext/pgrouting.nix index e51b8bada..7d2e62e4c 100644 --- a/nix/ext/pgrouting.nix +++ b/nix/ext/pgrouting.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { pname = "pgrouting"; - version = "3.4.1"; + version = "3.8.0"; nativeBuildInputs = [ cmake @@ -25,7 +25,7 @@ stdenv.mkDerivation rec { owner = "pgRouting"; repo = pname; rev = "v${version}"; - hash = "sha256-QC77AnPGpPQGEWi6JtJdiNsB2su5+aV2pKg5ImR2B0k="; + hash = "sha256-Lvf7TQ3GywbzZmcd9wi3s8I5sCXIQAPeXNTRk/J46to="; }; #disable compile time warnings for incompatible pointer types only on macos and pg16