Skip to content

Commit 6e50974

Browse files
authored
fix(nix): use the same postgresql inside switch-ext-version (#1990)
* fix(nix): use the same postgresql inside switch-ext-version currently, `switch-ext-version` uses `nixpkgs.postgresql`, instead of the `postgresql` chosen from outside. * chore: run nix fmt
1 parent 431bbc6 commit 6e50974

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

nix/packages/postgres.nix

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,16 @@
102102
dbExtensions17
103103
else
104104
ourExtensions;
105+
extCallPackage = pkgs.lib.callPackageWith (
106+
pkgs
107+
// {
108+
inherit postgresql;
109+
switch-ext-version = extCallPackage ./switch-ext-version.nix { };
110+
overlayfs-on-package = extCallPackage ./overlayfs-on-package.nix { };
111+
}
112+
);
105113
in
106-
map (path: pkgs.callPackage path { inherit postgresql; }) extensionsToUse;
114+
map (path: extCallPackage path { }) extensionsToUse;
107115

108116
# Create an attrset that contains all the extensions included in a server.
109117
makeOurPostgresPkgsSet =
@@ -136,12 +144,13 @@
136144
version:
137145
let
138146
postgresql = getPostgresqlPackage version;
147+
postgres-pkgs = makeOurPostgresPkgs version;
139148
ourExts = map (ext: {
140149
name = ext.name;
141150
version = ext.version;
142-
}) (makeOurPostgresPkgs version);
151+
}) postgres-pkgs;
143152

144-
pgbin = postgresql.withPackages (_ps: makeOurPostgresPkgs version);
153+
pgbin = postgresql.withPackages (_ps: postgres-pkgs);
145154
in
146155
pkgs.symlinkJoin {
147156
inherit (pgbin) name version;

0 commit comments

Comments
 (0)