diff --git a/nix/packages/extension-catalog.nix b/nix/packages/extension-catalog.nix index d8d559121..547f7baaa 100644 --- a/nix/packages/extension-catalog.nix +++ b/nix/packages/extension-catalog.nix @@ -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 // { @@ -163,6 +156,6 @@ ''; }; }; - legacyPackages = catalogs // versions; + legacyPackages = catalogs; }; } diff --git a/nix/packages/postgres.nix b/nix/packages/postgres.nix index 87daccdae..2568cc109 100644 --- a/nix/packages/postgres.nix +++ b/nix/packages/postgres.nix @@ -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: @@ -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" { };