From 33d25b81ec5f3ea0c673f063dcae90e6d9d57ecd Mon Sep 17 00:00:00 2001 From: samrose Date: Mon, 4 Mar 2024 13:25:15 -0500 Subject: [PATCH] chore: format (#50) --- ext/citus.nix | 16 +-- ext/hypopg.nix | 14 +-- ext/pg_graphql.nix | 14 +-- ext/pg_hashids.nix | 14 +-- ext/pg_jsonschema.nix | 14 +-- ext/pg_net.nix | 14 +-- ext/pg_plan_filter.nix | 14 +-- ext/pg_stat_monitor.nix | 19 ++-- ext/pg_tle.nix | 14 +-- ext/pgsodium.nix | 14 +-- ext/pgsql-http.nix | 14 +-- ext/pgvector.nix | 14 +-- ext/plv8.nix | 7 +- ext/supautils.nix | 14 +-- ext/vault.nix | 14 +-- ext/wrappers/default.nix | 25 +++-- flake.nix | 227 +++++++++++++++++++++------------------ overlays/gdal-small.nix | 18 ++-- 18 files changed, 252 insertions(+), 228 deletions(-) diff --git a/ext/citus.nix b/ext/citus.nix index cc3075f..0bb61ec 100644 --- a/ext/citus.nix +++ b/ext/citus.nix @@ -6,13 +6,13 @@ stdenv.mkDerivation rec { pname = "citus"; version = "12.1.2"; - buildInputs = [ curl lz4 zstd krb5 icu.dev postgresql]; + buildInputs = [ curl lz4 zstd krb5 icu.dev postgresql ]; src = fetchFromGitHub { - owner = "citusdata"; - repo = pname; - rev = "refs/tags/v${version}"; - hash = "sha256-0uYNMLAYigtGlDRvOEkQeC5i58QfXcdSVjTQwWVFX+8="; + owner = "citusdata"; + repo = pname; + rev = "refs/tags/v${version}"; + hash = "sha256-0uYNMLAYigtGlDRvOEkQeC5i58QfXcdSVjTQwWVFX+8="; }; installPhase = '' @@ -29,9 +29,9 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Distributed PostgreSQL as an extension"; - homepage = "https://github.com/citusdata/${pname}"; + homepage = "https://github.com/citusdata/${pname}"; maintainers = with maintainers; [ olirice ]; - platforms = postgresql.meta.platforms; - license = licenses.agpl3Plus; + platforms = postgresql.meta.platforms; + license = licenses.agpl3Plus; }; } diff --git a/ext/hypopg.nix b/ext/hypopg.nix index f07b0da..ea41c57 100644 --- a/ext/hypopg.nix +++ b/ext/hypopg.nix @@ -7,10 +7,10 @@ stdenv.mkDerivation rec { buildInputs = [ postgresql ]; src = fetchFromGitHub { - owner = "HypoPG"; - repo = pname; - rev = "refs/tags/${version}"; - hash = "sha256-AIBXy+LxyHUo+1hd8gQTwaBdFiTEzKaCVc4cx5tZgME="; + owner = "HypoPG"; + repo = pname; + rev = "refs/tags/${version}"; + hash = "sha256-AIBXy+LxyHUo+1hd8gQTwaBdFiTEzKaCVc4cx5tZgME="; }; installPhase = '' @@ -23,9 +23,9 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Hypothetical Indexes for PostgreSQL"; - homepage = "https://github.com/HypoPG/${pname}"; + homepage = "https://github.com/HypoPG/${pname}"; maintainers = with maintainers; [ thoughtpolice ]; - platforms = postgresql.meta.platforms; - license = licenses.postgresql; + platforms = postgresql.meta.platforms; + license = licenses.postgresql; }; } diff --git a/ext/pg_graphql.nix b/ext/pg_graphql.nix index f321c75..7ef16e0 100644 --- a/ext/pg_graphql.nix +++ b/ext/pg_graphql.nix @@ -6,10 +6,10 @@ buildPgrxExtension rec { inherit postgresql; src = fetchFromGitHub { - owner = "supabase"; - repo = pname; - rev = "v1.5.0"; - hash = "sha256-28ANRZyF22qF2YAxNAAkPfGOM3+xiO6IHdXsTp0CTQE="; + owner = "supabase"; + repo = pname; + rev = "v1.5.0"; + hash = "sha256-28ANRZyF22qF2YAxNAAkPfGOM3+xiO6IHdXsTp0CTQE="; }; cargoHash = "sha256-CUiGs0m9aUeqjpdPyOSjz91cP7TT6kjJqnw7ImGnQuo="; @@ -21,9 +21,9 @@ buildPgrxExtension rec { meta = with lib; { description = "GraphQL support for PostreSQL"; - homepage = "https://github.com/supabase/${pname}"; + homepage = "https://github.com/supabase/${pname}"; maintainers = with maintainers; [ thoughtpolice ]; - platforms = postgresql.meta.platforms; - license = licenses.postgresql; + platforms = postgresql.meta.platforms; + license = licenses.postgresql; }; } diff --git a/ext/pg_hashids.nix b/ext/pg_hashids.nix index 346cca3..9d237d0 100644 --- a/ext/pg_hashids.nix +++ b/ext/pg_hashids.nix @@ -7,10 +7,10 @@ stdenv.mkDerivation rec { buildInputs = [ postgresql ]; src = fetchFromGitHub { - owner = "iCyberon"; - repo = pname; - rev = "cd0e1b31d52b394a0df64079406a14a4f7387cd6"; - hash = "sha256-Nmb7XLqQflYZfqj0yrewfb1Hl5YgEB5wfjBunPwIuOU="; + owner = "iCyberon"; + repo = pname; + rev = "cd0e1b31d52b394a0df64079406a14a4f7387cd6"; + hash = "sha256-Nmb7XLqQflYZfqj0yrewfb1Hl5YgEB5wfjBunPwIuOU="; }; installPhase = '' @@ -23,9 +23,9 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Generate short unique IDs in PostgreSQL"; - homepage = "https://github.com/iCyberon/pg_hashids"; + homepage = "https://github.com/iCyberon/pg_hashids"; maintainers = with maintainers; [ thoughtpolice ]; - platforms = postgresql.meta.platforms; - license = licenses.postgresql; + platforms = postgresql.meta.platforms; + license = licenses.postgresql; }; } diff --git a/ext/pg_jsonschema.nix b/ext/pg_jsonschema.nix index 19c4ae2..df357f3 100644 --- a/ext/pg_jsonschema.nix +++ b/ext/pg_jsonschema.nix @@ -6,10 +6,10 @@ buildPgrxExtension rec { inherit postgresql; src = fetchFromGitHub { - owner = "supabase"; - repo = pname; - rev = "v0.3.0"; - hash = "sha256-am6Ye+pOoAsOr9L4vJXw4iIOJ9x0VkUjqH6PdXMUZrk="; + owner = "supabase"; + repo = pname; + rev = "v0.3.0"; + hash = "sha256-am6Ye+pOoAsOr9L4vJXw4iIOJ9x0VkUjqH6PdXMUZrk="; }; cargoHash = "sha256-tiiWzu/mTKL5ruvWn6IxrXVhVqS4LXzjfacdFT9rbOY="; @@ -20,9 +20,9 @@ buildPgrxExtension rec { meta = with lib; { description = "JSON Schema Validation for PostgreSQL"; - homepage = "https://github.com/supabase/${pname}"; + homepage = "https://github.com/supabase/${pname}"; maintainers = with maintainers; [ thoughtpolice ]; - platforms = postgresql.meta.platforms; - license = licenses.postgresql; + platforms = postgresql.meta.platforms; + license = licenses.postgresql; }; } diff --git a/ext/pg_net.nix b/ext/pg_net.nix index fc52857..919ef8b 100644 --- a/ext/pg_net.nix +++ b/ext/pg_net.nix @@ -7,10 +7,10 @@ stdenv.mkDerivation rec { buildInputs = [ curl postgresql ]; src = fetchFromGitHub { - owner = "supabase"; - repo = pname; - rev = "refs/tags/v${version}"; - hash = "sha256-9Ki3fyinHTYrfckxAY0fCTlzJd9l+n7QRUV7mIWrqmc="; + owner = "supabase"; + repo = pname; + rev = "refs/tags/v${version}"; + hash = "sha256-9Ki3fyinHTYrfckxAY0fCTlzJd9l+n7QRUV7mIWrqmc="; }; installPhase = '' @@ -23,9 +23,9 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Async networking for Postgres"; - homepage = "https://github.com/supabase/pg_net"; + homepage = "https://github.com/supabase/pg_net"; maintainers = with maintainers; [ thoughtpolice ]; - platforms = postgresql.meta.platforms; - license = licenses.postgresql; + platforms = postgresql.meta.platforms; + license = licenses.postgresql; }; } diff --git a/ext/pg_plan_filter.nix b/ext/pg_plan_filter.nix index 0db2e8f..49d839f 100644 --- a/ext/pg_plan_filter.nix +++ b/ext/pg_plan_filter.nix @@ -7,10 +7,10 @@ stdenv.mkDerivation rec { buildInputs = [ postgresql ]; src = fetchFromGitHub { - owner = "pgexperts"; - repo = pname; - rev = "5081a7b5cb890876e67d8e7486b6a64c38c9a492"; - hash = "sha256-YNeIfmccT/DtOrwDmpYFCuV2/P6k3Zj23VWBDkOh6sw="; + owner = "pgexperts"; + repo = pname; + rev = "5081a7b5cb890876e67d8e7486b6a64c38c9a492"; + hash = "sha256-YNeIfmccT/DtOrwDmpYFCuV2/P6k3Zj23VWBDkOh6sw="; }; installPhase = '' @@ -22,9 +22,9 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Filter PostgreSQL statements by execution plans"; - homepage = "https://github.com/pgexperts/${pname}"; + homepage = "https://github.com/pgexperts/${pname}"; maintainers = with maintainers; [ thoughtpolice ]; - platforms = postgresql.meta.platforms; - license = licenses.postgresql; + platforms = postgresql.meta.platforms; + license = licenses.postgresql; }; } diff --git a/ext/pg_stat_monitor.nix b/ext/pg_stat_monitor.nix index 95a5e3c..35e6b3b 100644 --- a/ext/pg_stat_monitor.nix +++ b/ext/pg_stat_monitor.nix @@ -14,17 +14,18 @@ let # then "pg_stat_monitor--1.0.13.sql.in" # else "pg_stat_monitor--1.0.14.sql.in"; -in stdenv.mkDerivation rec { +in +stdenv.mkDerivation rec { pname = "pg_stat_monitor"; version = "2.0.4"; buildInputs = [ postgresql ]; src = fetchFromGitHub { - owner = "percona"; - repo = pname; - rev = "refs/tags/${version}"; - hash = "sha256-57Ji/KltIHNf81OxT0+4JIDqydST5RKMqrybNBZochg="; + owner = "percona"; + repo = pname; + rev = "refs/tags/${version}"; + hash = "sha256-57Ji/KltIHNf81OxT0+4JIDqydST5RKMqrybNBZochg="; }; makeFlags = [ "USE_PGXS=1" ]; @@ -41,10 +42,10 @@ in stdenv.mkDerivation rec { meta = with lib; { description = "Query Performance Monitoring Tool for PostgreSQL"; - homepage = "https://github.com/percona/${pname}"; + homepage = "https://github.com/percona/${pname}"; maintainers = with maintainers; [ thoughtpolice ]; - platforms = postgresql.meta.platforms; - license = licenses.postgresql; - broken = lib.versionOlder postgresql.version "15"; + platforms = postgresql.meta.platforms; + license = licenses.postgresql; + broken = lib.versionOlder postgresql.version "15"; }; } diff --git a/ext/pg_tle.nix b/ext/pg_tle.nix index a5e4f72..626cd8a 100644 --- a/ext/pg_tle.nix +++ b/ext/pg_tle.nix @@ -8,10 +8,10 @@ stdenv.mkDerivation rec { buildInputs = [ postgresql ]; src = fetchFromGitHub { - owner = "aws"; - repo = pname; - rev = "refs/tags/v${version}"; - hash = "sha256-W/7pLy/27VatCdzUh1NZ4K2FRMD1erfHiFV2eY2x2W0="; + owner = "aws"; + repo = pname; + rev = "refs/tags/v${version}"; + hash = "sha256-W/7pLy/27VatCdzUh1NZ4K2FRMD1erfHiFV2eY2x2W0="; }; makeFlags = [ "FLEX=flex" ]; @@ -26,9 +26,9 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Framework for 'Trusted Language Extensions' in PostgreSQL"; - homepage = "https://github.com/aws/${pname}"; + homepage = "https://github.com/aws/${pname}"; maintainers = with maintainers; [ thoughtpolice ]; - platforms = postgresql.meta.platforms; - license = licenses.postgresql; + platforms = postgresql.meta.platforms; + license = licenses.postgresql; }; } diff --git a/ext/pgsodium.nix b/ext/pgsodium.nix index a7c5394..d97aa80 100644 --- a/ext/pgsodium.nix +++ b/ext/pgsodium.nix @@ -7,10 +7,10 @@ stdenv.mkDerivation rec { buildInputs = [ libsodium postgresql ]; src = fetchFromGitHub { - owner = "michelp"; - repo = pname; - rev = "refs/tags/v${version}"; - hash = "sha256-j5F1PPdwfQRbV8XJ8Mloi8FvZF0MTl4eyIJcBYQy1E4="; + owner = "michelp"; + repo = pname; + rev = "refs/tags/v${version}"; + hash = "sha256-j5F1PPdwfQRbV8XJ8Mloi8FvZF0MTl4eyIJcBYQy1E4="; }; installPhase = '' @@ -23,9 +23,9 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Modern cryptography for PostgreSQL"; - homepage = "https://github.com/michelp/${pname}"; + homepage = "https://github.com/michelp/${pname}"; maintainers = with maintainers; [ thoughtpolice ]; - platforms = postgresql.meta.platforms; - license = licenses.postgresql; + platforms = postgresql.meta.platforms; + license = licenses.postgresql; }; } diff --git a/ext/pgsql-http.nix b/ext/pgsql-http.nix index 2908027..e94e2ba 100644 --- a/ext/pgsql-http.nix +++ b/ext/pgsql-http.nix @@ -7,10 +7,10 @@ stdenv.mkDerivation rec { buildInputs = [ curl postgresql ]; src = fetchFromGitHub { - owner = "pramsey"; - repo = pname; - rev = "refs/tags/v${version}"; - hash = "sha256-CPHfx7vhWfxkXsoKTzyFuTt47BPMvzi/pi1leGcuD60="; + owner = "pramsey"; + repo = pname; + rev = "refs/tags/v${version}"; + hash = "sha256-CPHfx7vhWfxkXsoKTzyFuTt47BPMvzi/pi1leGcuD60="; }; installPhase = '' @@ -23,9 +23,9 @@ stdenv.mkDerivation rec { meta = with lib; { description = "HTTP client for Postgres"; - homepage = "https://github.com/pramsey/${pname}"; + homepage = "https://github.com/pramsey/${pname}"; maintainers = with maintainers; [ thoughtpolice ]; - platforms = postgresql.meta.platforms; - license = licenses.postgresql; + platforms = postgresql.meta.platforms; + license = licenses.postgresql; }; } diff --git a/ext/pgvector.nix b/ext/pgvector.nix index fa2f55d..996a671 100644 --- a/ext/pgvector.nix +++ b/ext/pgvector.nix @@ -7,10 +7,10 @@ stdenv.mkDerivation rec { buildInputs = [ postgresql ]; src = fetchFromGitHub { - owner = "pgvector"; - repo = pname; - rev = "refs/tags/v${version}"; - hash = "sha256-ZNzq+dATZn9LUgeOczsaadr5hwdbt9y/+sAOPIdr77U="; + owner = "pgvector"; + repo = pname; + rev = "refs/tags/v${version}"; + hash = "sha256-ZNzq+dATZn9LUgeOczsaadr5hwdbt9y/+sAOPIdr77U="; }; installPhase = '' @@ -23,9 +23,9 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Open-source vector similarity search for Postgres"; - homepage = "https://github.com/${src.owner}/${src.repo}"; + homepage = "https://github.com/${src.owner}/${src.repo}"; maintainers = with maintainers; [ olirice ]; - platforms = postgresql.meta.platforms; - license = licenses.postgresql; + platforms = postgresql.meta.platforms; + license = licenses.postgresql; }; } diff --git a/ext/plv8.nix b/ext/plv8.nix index 32586a5..0ff1fb4 100644 --- a/ext/plv8.nix +++ b/ext/plv8.nix @@ -4,7 +4,7 @@ , v8 , perl , postgresql -# For test + # For test , runCommand , coreutils , gnugrep @@ -77,8 +77,9 @@ stdenv.mkDerivation (finalAttrs: { postgresqlWithSelf = postgresql.withPackages (_: [ finalAttrs.finalPackage ]); - in { - smoke = runCommand "plv8-smoke-test" {} '' + in + { + smoke = runCommand "plv8-smoke-test" { } '' export PATH=${lib.makeBinPath [ postgresqlWithSelf coreutils diff --git a/ext/supautils.nix b/ext/supautils.nix index 89bfcc9..9e6d4d4 100644 --- a/ext/supautils.nix +++ b/ext/supautils.nix @@ -7,10 +7,10 @@ stdenv.mkDerivation rec { buildInputs = [ postgresql ]; src = fetchFromGitHub { - owner = "supabase"; - repo = pname; - rev = "refs/tags/v${version}"; - hash = "sha256-cQ294UNhlPtnqngGTVLYPMbGcqhqjFk5y6WBz6nCZhI="; + owner = "supabase"; + repo = pname; + rev = "refs/tags/v${version}"; + hash = "sha256-cQ294UNhlPtnqngGTVLYPMbGcqhqjFk5y6WBz6nCZhI="; }; installPhase = '' @@ -21,9 +21,9 @@ stdenv.mkDerivation rec { meta = with lib; { description = "PostgreSQL extension for enhanced security"; - homepage = "https://github.com/supabase/${pname}"; + homepage = "https://github.com/supabase/${pname}"; maintainers = with maintainers; [ steve-chavez ]; - platforms = postgresql.meta.platforms; - license = licenses.postgresql; + platforms = postgresql.meta.platforms; + license = licenses.postgresql; }; } diff --git a/ext/vault.nix b/ext/vault.nix index a50a2e0..4e2684a 100644 --- a/ext/vault.nix +++ b/ext/vault.nix @@ -7,10 +7,10 @@ stdenv.mkDerivation rec { buildInputs = [ postgresql ]; src = fetchFromGitHub { - owner = "supabase"; - repo = pname; - rev = "refs/tags/v${version}"; - hash = "sha256-kXTngBW4K6FkZM8HvJG2Jha6OQqbejhnk7tchxy031I="; + owner = "supabase"; + repo = pname; + rev = "refs/tags/v${version}"; + hash = "sha256-kXTngBW4K6FkZM8HvJG2Jha6OQqbejhnk7tchxy031I="; }; installPhase = '' @@ -22,9 +22,9 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Store encrypted secrets in PostgreSQL"; - homepage = "https://github.com/supabase/${pname}"; + homepage = "https://github.com/supabase/${pname}"; maintainers = with maintainers; [ thoughtpolice ]; - platforms = postgresql.meta.platforms; - license = licenses.postgresql; + platforms = postgresql.meta.platforms; + license = licenses.postgresql; }; } diff --git a/ext/wrappers/default.nix b/ext/wrappers/default.nix index d314944..89299a2 100644 --- a/ext/wrappers/default.nix +++ b/ext/wrappers/default.nix @@ -1,5 +1,10 @@ -{ lib, stdenv, fetchFromGitHub, openssl, pkg-config -, postgresql, buildPgrxExtension_0_11_2 +{ lib +, stdenv +, fetchFromGitHub +, openssl +, pkg-config +, postgresql +, buildPgrxExtension_0_11_2 }: buildPgrxExtension_0_11_2 rec { @@ -8,13 +13,13 @@ buildPgrxExtension_0_11_2 rec { inherit postgresql; src = fetchFromGitHub { - owner = "supabase"; - repo = "wrappers"; + owner = "supabase"; + repo = "wrappers"; #rev pinned for now to the HEAD of the main branch to achieve cargo-pgrx 0.11.2 compat - rev = "5b5c2622268c75bec834a38b2ff967f781511188"; - hash = "sha256-VwEFJD0yD+gvXCTzq9NfjCPEkh/lDQdEOPfk8LwK4z4="; + rev = "5b5c2622268c75bec834a38b2ff967f781511188"; + hash = "sha256-VwEFJD0yD+gvXCTzq9NfjCPEkh/lDQdEOPfk8LwK4z4="; }; - + nativeBuildInputs = [ pkg-config ]; buildInputs = [ openssl ]; @@ -48,9 +53,9 @@ buildPgrxExtension_0_11_2 rec { meta = with lib; { description = "Various Foreign Data Wrappers (FDWs) for PostreSQL"; - homepage = "https://github.com/supabase/wrappers"; + homepage = "https://github.com/supabase/wrappers"; maintainers = with maintainers; [ thoughtpolice ]; - platforms = postgresql.meta.platforms; - license = licenses.postgresql; + platforms = postgresql.meta.platforms; + license = licenses.postgresql; }; } diff --git a/flake.nix b/flake.nix index bb71aee..93861ce 100644 --- a/flake.nix +++ b/flake.nix @@ -17,16 +17,19 @@ ]; }; - outputs = { self, nixpkgs, flake-utils, nix2container }: let - gitRev = "vcs=${self.shortRev or "dirty"}+${builtins.substring 0 8 (self.lastModifiedDate or self.lastModified or "19700101")}"; - - ourSystems = with flake-utils.lib; [ - system.x86_64-linux - system.aarch64-linux - ]; in flake-utils.lib.eachSystem ourSystems (system: + outputs = { self, nixpkgs, flake-utils, nix2container }: + let + gitRev = "vcs=${self.shortRev or "dirty"}+${builtins.substring 0 8 (self.lastModifiedDate or self.lastModified or "19700101")}"; + + ourSystems = with flake-utils.lib; [ + system.x86_64-linux + system.aarch64-linux + ]; + in + flake-utils.lib.eachSystem ourSystems (system: let pgsqlDefaultPort = "5435"; - pgsqlSuperuser = "postgres"; + pgsqlSuperuser = "postgres"; nix2img = nix2container.packages.${system}.nix2container; # The 'pkgs' variable holds all the upstream packages in nixpkgs, which @@ -47,9 +50,10 @@ # FIXME (aseipp): pg_prove is yet another perl program that needs # LOCALE_ARCHIVE set in non-NixOS environments. upstream this. once that's done, we # can remove this wrapper. - pg_prove = pkgs.runCommand "pg_prove" { - nativeBuildInputs = [ pkgs.makeWrapper ]; - } '' + pg_prove = pkgs.runCommand "pg_prove" + { + nativeBuildInputs = [ pkgs.makeWrapper ]; + } '' mkdir -p $out/bin for x in pg_prove pg_tapgen; do makeWrapper "${pkgs.perlPackages.TAPParserSourceHandlerpgTAP}/bin/$x" "$out/bin/$x" \ @@ -150,9 +154,11 @@ # Create an attrset that contains all the extensions included in a server. makeOurPostgresPkgsSet = version: - (builtins.listToAttrs (map (drv: - { name = drv.pname; value = drv; } - ) (makeOurPostgresPkgs version))) + (builtins.listToAttrs (map + (drv: + { name = drv.pname; value = drv; } + ) + (makeOurPostgresPkgs version))) // { recurseForDerivations = true; }; # Create a binary distribution of PostgreSQL, given a version. @@ -166,25 +172,28 @@ makePostgresBin = version: let postgresql = pkgs."postgresql_${version}"; - upstreamExts = map (ext: { - name = postgresql.pkgs."${ext}".pname; - version = postgresql.pkgs."${ext}".version; - }) psqlExtensions; + upstreamExts = map + (ext: { + name = postgresql.pkgs."${ext}".pname; + version = postgresql.pkgs."${ext}".version; + }) + psqlExtensions; ourExts = map (ext: { name = ext.pname; version = ext.version; }) (makeOurPostgresPkgs version); pgbin = postgresql.withPackages (ps: (map (ext: ps."${ext}") psqlExtensions) ++ (makeOurPostgresPkgs version) ); - in pkgs.symlinkJoin { + in + pkgs.symlinkJoin { inherit (pgbin) name version; paths = [ pgbin (makeReceipt pgbin upstreamExts ourExts) ]; }; # Make a Docker Image from a given PostgreSQL version and binary package. # updated to use https://github.com/nlewo/nix2container (samrose) - makePostgresDocker = version: binPackage: - let - initScript = pkgs.runCommand "docker-init.sh" {} '' + makePostgresDocker = version: binPackage: + let + initScript = pkgs.runCommand "docker-init.sh" { } '' mkdir -p $out/bin substitute ${./docker/init.sh.in} $out/bin/init.sh \ --subst-var-by 'PGSQL_DEFAULT_PORT' '${pgsqlDefaultPort}' @@ -192,65 +201,65 @@ chmod +x $out/bin/init.sh ''; - postgresqlConfig = pkgs.runCommand "postgresql.conf" {} '' + postgresqlConfig = pkgs.runCommand "postgresql.conf" { } '' mkdir -p $out/etc/ substitute ${./tests/postgresql.conf.in} $out/etc/postgresql.conf \ --subst-var-by 'PGSQL_DEFAULT_PORT' '${pgsqlDefaultPort}' \ --subst-var-by PGSODIUM_GETKEY_SCRIPT "${./tests/util/pgsodium_getkey.sh}" ''; - l = pkgs.lib // builtins; - - user = "postgres"; - group = "postgres"; - uid = "1001"; - gid = "1001"; - - mkUser = pkgs.runCommand "mkUser" { } '' - mkdir -p $out/etc/pam.d - - echo "${user}:x:${uid}:${gid}::" > $out/etc/passwd - echo "${user}:!x:::::::" > $out/etc/shadow - - echo "${group}:x:${gid}:" > $out/etc/group - echo "${group}:x::" > $out/etc/gshadow - - cat > $out/etc/pam.d/other < $out/etc/passwd + echo "${user}:!x:::::::" > $out/etc/shadow + + echo "${group}:x:${gid}:" > $out/etc/group + echo "${group}:x::" > $out/etc/gshadow + + cat > $out/etc/pam.d/other <