diff --git a/default.nix b/default.nix index ddd610b197b..16f006e7131 100644 --- a/default.nix +++ b/default.nix @@ -46,7 +46,7 @@ let # Static derivation for the PostgREST executable. drvStatic = - import nix/static.nix { + import nix/static { inherit pkgs name src; # Currently only works with GHC 8.6.5. compiler = "ghc865"; diff --git a/nix/nixpkgs-version.nix b/nix/nixpkgs-version.nix index 4607dadeddb..affe8a1960b 100644 --- a/nix/nixpkgs-version.nix +++ b/nix/nixpkgs-version.nix @@ -1,6 +1,6 @@ # Pinned version of Nixpkgs, generated with nixpkgs-upgrade. { - date = "2020-04-19"; + date = "2020-04-23"; rev = "10100a97c8964e82b30f180fda41ade8e6f69e41"; tarballHash = "011f36kr3c1ria7rag7px26bh73d1b0xpqadd149bysf4hg17rln"; } diff --git a/nix/postgrest.nix b/nix/postgrest.nix deleted file mode 100644 index 2395894e3df..00000000000 --- a/nix/postgrest.nix +++ /dev/null @@ -1,164 +0,0 @@ -{ name -, src -, mkDerivation -, aeson -, aeson-qq -, ansi-wl-pprint -, async -, auto-update -, base -, base64-bytestring -, bytestring -, case-insensitive -, cassava -, configurator-pg -, containers -, contravariant -, contravariant-extras -, cookie -, directory -, either -, gitrev -, hasql -, hasql-pool -, hasql-transaction -, heredoc -, hspec -, hspec-wai -, hspec-wai-json -, HTTP -, http-types -, insert-ordered-containers -, interpolatedstring-perl6 -, jose -, lens -, lens-aeson -, monad-control -, network -, network-uri -, optparse-applicative -, parsec -, process -, protolude -, Ranged-sets -, regex-tdfa -, retry -, scientific -, stdenv -, swagger2 -, text -, time -, transformers-base -, unix -, unordered-containers -, vector -, wai -, wai-cors -, wai-extra -, wai-middleware-static -, warp -}: -mkDerivation { - inherit src; - pname = name; - version = "7.0.0"; - isLibrary = true; - isExecutable = true; - libraryHaskellDepends = [ - aeson - ansi-wl-pprint - base - base64-bytestring - bytestring - case-insensitive - cassava - configurator-pg - containers - contravariant - contravariant-extras - cookie - either - gitrev - hasql - hasql-pool - hasql-transaction - heredoc - HTTP - http-types - insert-ordered-containers - interpolatedstring-perl6 - jose - lens - lens-aeson - network-uri - optparse-applicative - parsec - protolude - Ranged-sets - regex-tdfa - scientific - swagger2 - text - time - unordered-containers - vector - wai - wai-cors - wai-extra - wai-middleware-static - ]; - executableHaskellDepends = [ - auto-update - base - base64-bytestring - bytestring - directory - either - hasql - hasql-pool - hasql-transaction - network - protolude - retry - text - time - unix - wai - warp - ]; - testHaskellDepends = [ - aeson - aeson-qq - async - auto-update - base - base64-bytestring - bytestring - case-insensitive - cassava - containers - contravariant - hasql - hasql-pool - hasql-transaction - heredoc - hspec - hspec-wai - hspec-wai-json - http-types - lens - lens-aeson - monad-control - process - protolude - regex-tdfa - text - time - transformers-base - wai - wai-extra - ]; - homepage = "https://postgrest.org"; - description = "REST API for any Postgres database"; - license = stdenv.lib.licenses.mit; -} diff --git a/nix/static/Cabal.nix b/nix/static/Cabal.nix new file mode 100644 index 00000000000..cecaf723990 --- /dev/null +++ b/nix/static/Cabal.nix @@ -0,0 +1,27 @@ +{ mkDerivation, array, base, base-compat, base-orphans, binary +, bytestring, containers, deepseq, Diff, directory, filepath +, integer-logarithms, mtl, optparse-applicative, parsec, pretty +, process, QuickCheck, stdenv, stm, tagged, tar, tasty +, tasty-golden, tasty-hunit, tasty-quickcheck, temporary, text +, time, transformers, tree-diff, unix +}: +mkDerivation { + pname = "Cabal"; + version = "3.0.0.0"; + sha256 = "5143ec26d740c1a508c93a8860e64407e7546c29b9817db20ff1595c1968d287"; + setupHaskellDepends = [ mtl parsec ]; + libraryHaskellDepends = [ + array base binary bytestring containers deepseq directory filepath + mtl parsec pretty process text time transformers unix + ]; + testHaskellDepends = [ + array base base-compat base-orphans binary bytestring containers + deepseq Diff directory filepath integer-logarithms + optparse-applicative pretty process QuickCheck stm tagged tar tasty + tasty-golden tasty-hunit tasty-quickcheck temporary text tree-diff + ]; + doCheck = false; + homepage = "http://www.haskell.org/cabal/"; + description = "A framework for packaging Haskell software"; + license = stdenv.lib.licenses.bsd3; +} diff --git a/nix/static.nix b/nix/static/default.nix similarity index 86% rename from nix/static.nix rename to nix/static/default.nix index d350c17f1e8..7d350a7871f 100644 --- a/nix/static.nix +++ b/nix/static/default.nix @@ -28,18 +28,17 @@ let final: prev: { # Add our source package. - "${name}" = - #prev.callPackage ./postgrest.nix { inherit name src; }; - prev.callCabal2nix name src {}; + "${name}" = prev.callCabal2nix name src {}; - Cabal = prev.Cabal_3_2_0_0; + # cabal2nix depends on Cabal 3.0.*, while our pinned version of Nixpkgs + # only provides 2.4 or 3.2. So we pinned 3.0.0.0 in ./Cabal.nix + cabal2nix = + prev.cabal2nix.overrideScope + (self: super: { Cabal = self.callPackage ./Cabal.nix {}; }); # The tests for the packages below took a long time on static # builds, so we disable them for now - to be investigated. happy = self.haskell.lib.dontCheck prev.happy; - text-short = self.haskell.lib.dontCheck prev.text-short; - jose = self.haskell.lib.dontCheck prev.jose; - tls = self.haskell.lib.dontCheck prev.tls; }; in # Override the set of Haskell packages at