Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions nix/packages/extension-catalog.nix
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,6 @@
''
)
) perMajor;

versions = lib.mapAttrs' (
major: wrappers:
lib.nameValuePair "site-extensions-versions-${major}" (
lib.recurseIntoAttrs (lib.mapAttrs (_: lib.recurseIntoAttrs) wrappers)
)
) perMajor;
in
{
packages = catalogs // {
Expand Down Expand Up @@ -163,6 +156,6 @@
'';
};
};
legacyPackages = catalogs // versions;
legacyPackages = catalogs;
};
}
40 changes: 34 additions & 6 deletions nix/packages/postgres.nix
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,22 @@
in
map (path: extCallPackage path { }) extensionsToUse;

# Build a single extension package, standalone (not the whole server's set).
makeSingleExt =
version: latestOnly: extPath:
let
postgresql = getPostgresqlPackage version latestOnly;
extCallPackage = pkgs.lib.callPackageWith (
pkgs
// {
inherit postgresql latestOnly;
switch-ext-version = extCallPackage ./switch-ext-version.nix { };
overlayfs-on-package = extCallPackage ./overlayfs-on-package.nix { };
}
);
in
extCallPackage extPath { };

# Create an attrset that contains all the extensions included in a server.
makeOurPostgresPkgsSet =
version:
Expand Down Expand Up @@ -215,18 +231,30 @@
# - bin: the postgresql package itself, with all the extensions
# installed, and a receipt.json file containing metadata about the
# install.
# - exts: an attrset containing all the extensions, mapped to their
# package names.
# - exts: an attrset containing extension packages. The "cli" variant
# doesn't expose it (nothing reads it: checks.nix's cli check
# harness borrows pgroonga from the full psql_17 instead). The
# "slim" variants (latestOnly) only expose pgroonga, the one
# extension checks.nix actually needs from them, instead of every
# extension - each of which would otherwise be its own CI job.
makePostgres =
version:
{
variant ? "full",
latestOnly ? false,
}:
lib.recurseIntoAttrs {
bin = makePostgresBin version { inherit variant latestOnly; };
exts = makeOurPostgresPkgsSet version { inherit variant latestOnly; };
};
lib.recurseIntoAttrs (
{
bin = makePostgresBin version { inherit variant latestOnly; };
}
// lib.optionalAttrs (variant != "cli") {
exts =
if latestOnly then
{ pgroonga = makeSingleExt version latestOnly ../ext/pgroonga; }
else
makeOurPostgresPkgsSet version { inherit variant latestOnly; };
}
);
basePackages = {
psql_15 = makePostgres "15" { };
psql_17 = makePostgres "17" { };
Expand Down
Loading