diff --git a/default.nix b/default.nix index 478e424e1c..729568cfec 100644 --- a/default.nix +++ b/default.nix @@ -36,6 +36,7 @@ let allOverlays.build-toolbox allOverlays.checked-shell-script allOverlays.gitignore + allOverlays.postgis allOverlays.postgresql-default allOverlays.postgresql-legacy allOverlays.postgresql-future diff --git a/nix/nixpkgs-version.nix b/nix/nixpkgs-version.nix index 4e3d404ce6..4d0a3947f3 100644 --- a/nix/nixpkgs-version.nix +++ b/nix/nixpkgs-version.nix @@ -1,6 +1,6 @@ # Pinned version of Nixpkgs, generated with postgrest-nixpkgs-upgrade. { - date = "2022-08-09"; - rev = "9f15d6c3a74d2778c6e1af67947c95f100dc6fd2"; - tarballHash = "14axdmi3kb6rlib39ik42yq907bm66x6vzswm5w1rsnw9vzgm31a"; + date = "2022-09-30"; + rev = "8ba120420fbdd9bd35b3a5366fa0206d8c99ade3"; + tarballHash = "0hfaagh0jnkk85gyj07y3daszfbz8mlafrn3wc3z9875f36810xi"; } diff --git a/nix/overlays/checked-shell-script/checked-shell-script.nix b/nix/overlays/checked-shell-script/checked-shell-script.nix index e3c382e6d6..591f9f8947 100644 --- a/nix/overlays/checked-shell-script/checked-shell-script.nix +++ b/nix/overlays/checked-shell-script/checked-shell-script.nix @@ -2,7 +2,7 @@ # directly, or use the .bin attribute to get the script in a bin/ directory, # to be used in a path for example. { argbash -, bash_5 +, bash , coreutils , git , lib @@ -77,7 +77,7 @@ let text = '' - #!${bash_5}/bin/bash + #!${bash}/bin/bash source ${argsParser} set -euo pipefail '' diff --git a/nix/overlays/default.nix b/nix/overlays/default.nix index 05480d5e5f..43d1548688 100644 --- a/nix/overlays/default.nix +++ b/nix/overlays/default.nix @@ -3,6 +3,7 @@ checked-shell-script = import ./checked-shell-script; gitignore = import ./gitignore.nix; haskell-packages = import ./haskell-packages.nix; + postgis = import ./postgis.nix; postgresql-default = import ./postgresql-default.nix; postgresql-legacy = import ./postgresql-legacy.nix; postgresql-future = import ./postgresql-future.nix; diff --git a/nix/overlays/haskell-packages.nix b/nix/overlays/haskell-packages.nix index 416cc6b6c9..263585458b 100644 --- a/nix/overlays/haskell-packages.nix +++ b/nix/overlays/haskell-packages.nix @@ -30,49 +30,16 @@ let # update-nix-fetchgit nix/overlays/haskell-packages.nix hashtables = lib.dontCheck prev.hashtables_1_3; + hasql = lib.dontCheck prev.hasql_1_6_1_3; + hasql-dynamic-statements = lib.dontCheck prev.hasql-dynamic-statements_0_3_1_2; + hasql-pool = lib.dontCheck prev.hasql-pool_0_8_0_3; + hasql-transaction = lib.dontCheck prev.hasql-transaction_1_0_1_2; isomorphism-class = lib.unmarkBroken prev.isomorphism-class; + lens = lib.dontCheck prev.lens_5_2; + postgresql-binary = lib.dontCheck prev.postgresql-binary_0_13; text-builder = lib.dontCheck prev.text-builder_0_6_7; text-builder-dev = lib.dontCheck prev.text-builder-dev_0_3_3; - postgresql-binary = lib.dontCheck - (prev.callHackageDirect - { - pkg = "postgresql-binary"; - ver = "0.12.5"; - sha256 = "1vk97lw25i7d0pvjzd7s3m13nya9ycnrjr8y4qhw2jgjnvkblnzv"; - } - { }); - - hasql = lib.dontCheck - (prev.callHackageDirect - { - pkg = "hasql"; - ver = "1.6.1.1"; - sha256 = "1sv0500dvfln9ljxkd2jrfl9nbpkax7z5b8zjy9yjps1r6s1cmj0"; - } - { }); - - hasql-dynamic-statements = lib.dontCheck prev.hasql-dynamic-statements_0_3_1_2; - hasql-transaction = lib.dontCheck prev.hasql-transaction_1_0_1_2; - - hasql-notifications = lib.dontCheck - (prev.callHackageDirect - { - pkg = "hasql-notifications"; - ver = "0.2.0.3"; - sha256 = "1v44fp03685ngs1l9a7ihkfg5zgvh49k7ym9sh70wjsqql80dhf7"; - } - { }); - - hasql-pool = lib.dontCheck - (prev.callHackageDirect - { - pkg = "hasql-pool"; - ver = "0.8.0.2"; - sha256 = "0a646w7m1p430hp52q8d52sgd14zcyrjvflmw7qbak565jmksqgl"; - } - { }); - postgresql-libpq = lib.dontCheck (prev.callCabal2nix "postgresql-libpq" (super.fetchFromGitHub { diff --git a/nix/overlays/postgis.nix b/nix/overlays/postgis.nix new file mode 100644 index 0000000000..846fb7a857 --- /dev/null +++ b/nix/overlays/postgis.nix @@ -0,0 +1,27 @@ +final: prev: +let + postgis_3_2_3 = rec { + version = "3.2.3"; + src = final.fetchurl { + url = "https://download.osgeo.org/postgis/source/postgis-${version}.tar.gz"; + sha256 = "sha256-G02LXHVuWrpZ77wYM7Iu/k1lYneO7KVvpJf+susTZow="; + }; + }; +in +{ + postgresql_11 = prev.postgresql_11.override { this = final.postgresql_11; } // { + pkgs = prev.postgresql_11.pkgs // { + postgis = prev.postgresql_11.pkgs.postgis.overrideAttrs (_: postgis_3_2_3); + }; + }; + postgresql_10 = prev.postgresql_10.override { this = final.postgresql_11; } // { + pkgs = prev.postgresql_10.pkgs // { + postgis = prev.postgresql_10.pkgs.postgis.overrideAttrs (_: postgis_3_2_3); + }; + }; + postgresql_9_6 = prev.postgresql_9_6.override { this = final.postgresql_11; } // { + pkgs = prev.postgresql_9_6.pkgs // { + postgis = prev.postgresql_9_6.pkgs.postgis.overrideAttrs (_: postgis_3_2_3); + }; + }; +} diff --git a/nix/patches/default.nix b/nix/patches/default.nix index 957db93af9..c262f0c4bc 100644 --- a/nix/patches/default.nix +++ b/nix/patches/default.nix @@ -22,4 +22,6 @@ ./static-haskell-nix-ncurses.patch; static-haskell-nix-ghc-bignum = ./static-haskell-nix-ghc-bignum.patch; + static-haskell-nix-openssl = + ./static-haskell-nix-openssl.patch; } diff --git a/nix/patches/static-haskell-nix-openssl.patch b/nix/patches/static-haskell-nix-openssl.patch new file mode 100644 index 0000000000..e580549f17 --- /dev/null +++ b/nix/patches/static-haskell-nix-openssl.patch @@ -0,0 +1,12 @@ +diff --git a/survey/default.nix b/survey/default.nix +index cf1bd31..9d34753 100644 +--- a/survey/default.nix ++++ b/survey/default.nix +@@ -736,6 +736,7 @@ let + openblas = previous.openblas.override { enableStatic = true; }; + + openssl = previous.openssl.override { static = true; }; ++ openssl_1_1 = previous.openssl_1_1.override { static = true; }; + + libsass = previous.libsass.overrideAttrs (old: { dontDisableStatic = true; }); + diff --git a/nix/static-haskell-package.nix b/nix/static-haskell-package.nix index 209b5bf919..747d15c36c 100644 --- a/nix/static-haskell-package.nix +++ b/nix/static-haskell-package.nix @@ -19,6 +19,7 @@ let [ patches.static-haskell-nix-ncurses patches.static-haskell-nix-ghc-bignum + patches.static-haskell-nix-openssl ]; extraOverrides = diff --git a/nix/tools/nixpkgsTools.nix b/nix/tools/nixpkgsTools.nix index 3c938fdaca..c4128e5b9c 100644 --- a/nix/tools/nixpkgsTools.nix +++ b/nix/tools/nixpkgsTools.nix @@ -1,5 +1,6 @@ { buildToolbox , checkedShellScript +, coreutils , curl , jq , nix @@ -33,7 +34,7 @@ let commitHash="$(${curl}/bin/curl "${refUrl}" -H "${githubV3Header}" | ${jq}/bin/jq -r .object.sha)" tarballUrl="${tarballUrlBase}$commitHash.tar.gz" tarballHash="$(${nix}/bin/nix-prefetch-url --unpack "$tarballUrl")" - currentDate="$(date --iso)" + currentDate="$(${coreutils}/bin/date --iso)" cat > nix/nixpkgs-version.nix << EOF # Pinned version of Nixpkgs, generated with ${name}. diff --git a/nix/tools/tests.nix b/nix/tools/tests.nix index 14ebc97399..6cc812857e 100644 --- a/nix/tools/tests.nix +++ b/nix/tools/tests.nix @@ -80,7 +80,7 @@ let python3.withPackages (ps: [ ps.pyjwt ps.pytest - ps.pytest_xdist + ps.pytest-xdist ps.pyyaml ps.requests ps.requests-unixsocket diff --git a/postgrest.cabal b/postgrest.cabal index 919ea66fff..1e9ef9b878 100644 --- a/postgrest.cabal +++ b/postgrest.cabal @@ -96,7 +96,7 @@ library , insert-ordered-containers >= 0.2.2 && < 0.3 , interpolatedstring-perl6 >= 1 && < 1.1 , jose >= 0.8.5.1 && < 0.11 - , lens >= 4.14 && < 5.2 + , lens >= 4.14 && < 5.3 , lens-aeson >= 1.0.1 && < 1.2 , mtl >= 2.2.2 && < 2.3 , network >= 2.6 && < 3.2 @@ -234,7 +234,7 @@ test-suite spec , hspec-wai >= 0.10 && < 0.12 , hspec-wai-json >= 0.10 && < 0.12 , http-types >= 0.12.3 && < 0.13 - , lens >= 4.14 && < 5.2 + , lens >= 4.14 && < 5.3 , lens-aeson >= 1.0.1 && < 1.2 , monad-control >= 1.0.1 && < 1.1 , postgrest @@ -277,7 +277,7 @@ test-suite querycost , hspec-wai >= 0.10 && < 0.12 , hspec-wai-json >= 0.10 && < 0.12 , http-types >= 0.12.3 && < 0.13 - , lens >= 4.14 && < 5.2 + , lens >= 4.14 && < 5.3 , lens-aeson >= 1.0.1 && < 1.2 , postgrest , process >= 1.4.2 && < 1.7