Skip to content

Commit 15a7cfb

Browse files
yvan-srakasamrose
authored andcommitted
refactor(exts): replace nixpkgs-oldstable with specific overlay packages
Use overlay instead of passing full nixpkgs-oldstable to avoid exposing entire old nixpkgs attribute set. Now provides specific packages (curl_8_4, v8_oldstable) through overlay.
1 parent 9f454b1 commit 15a7cfb

File tree

4 files changed

+21
-6
lines changed

4 files changed

+21
-6
lines changed

nix/ext/pg_jsonschema/default.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ let
8282
cargo pgrx init --pg${lib.versions.major postgresql.version} $PGRX_HOME/${lib.versions.major postgresql.version}/bin/pg_config
8383
'';
8484

85+
# Tests are disabled for specific versions because pgrx tests require
86+
# `cargo pgrx install --test` which fails in the nix sandbox due to
87+
# write permission restrictions. Unlike pg_graphql which has a custom
88+
# installcheck script, pg_jsonschema only has pgrx cargo tests.
89+
# See: https://github.com/supabase/pg_jsonschema/blob/v0.3.3/src/lib.rs#L45-L195
8590
doCheck =
8691
!(builtins.elem version [
8792
"0.2.0"

nix/ext/pg_net.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
libuv,
88
makeWrapper,
99
switch-ext-version,
10-
nixpkgs-oldstable,
10+
curl_8_6,
1111
}:
1212

1313
let
14-
curl = nixpkgs-oldstable.curl;
14+
curl = curl_8_6;
1515
in
1616
let
1717
pname = "pg_net";

nix/ext/plv8/default.nix

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
stdenv,
33
lib,
44
fetchFromGitHub,
5-
# v8,
65
perl,
76
postgresql,
87
# For passthru test on various systems, and local development on macos
@@ -14,7 +13,7 @@
1413
buildEnv,
1514
nodejs_20,
1615
libcxx,
17-
nixpkgs-oldstable,
16+
v8_oldstable,
1817
}:
1918

2019
let
@@ -37,7 +36,7 @@ let
3736
);
3837

3938
# plv8 3.1 requires an older version of v8 (we cannot use nodejs.libv8)
40-
inherit (nixpkgs-oldstable) v8;
39+
v8 = v8_oldstable;
4140

4241
# Build function for individual versions
4342
build =

nix/nixpkgs.nix

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,21 @@
1111
(import inputs.rust-overlay)
1212
self.overlays.default
1313
(_final: _prev: {
14-
nixpkgs-oldstable = import inputs.nixpkgs-oldstable {
14+
# Provide older versions of packages required by some extensions
15+
oldstable = import inputs.nixpkgs-oldstable {
1516
inherit system;
1617
config.allowUnfree = true;
1718
};
19+
curl_8_6 =
20+
(import inputs.nixpkgs-oldstable {
21+
inherit system;
22+
config.allowUnfree = true;
23+
}).curl;
24+
v8_oldstable =
25+
(import inputs.nixpkgs-oldstable {
26+
inherit system;
27+
config.allowUnfree = true;
28+
}).v8;
1829
})
1930
];
2031
};

0 commit comments

Comments
 (0)