Skip to content

Commit

Permalink
Trying to fix nix so postgrest can depend on okapi
Browse files Browse the repository at this point in the history
  • Loading branch information
rashadg1030 committed Jun 1, 2022
1 parent e84cd28 commit 92660ed
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 12 deletions.
47 changes: 46 additions & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,54 @@ let
patches =
pkgs.callPackage nix/patches { };

# FOR BUILDING OKAPI START #

okapiPkgs = pkgs.haskell.packages."${compiler}".override {
overrides = self: super: rec {
# Can add/override packages here
text =
self.callCabal2nix "text" (builtins.fetchTarball {
url = "https://hackage.haskell.org/package/text-1.2.5.0/text-1.2.5.0.tar.gz";
# sha256 = "...";
}) {};
bytestring =
self.callCabal2nix "bytestring" (builtins.fetchTarball {
url = "https://hackage.haskell.org/package/bytestring-0.10.12.1/bytestring-0.10.12.1.tar.gz";
# sha256 = "...";
}) {};
http-api-data =
self.callCabal2nix "http-api-data" (builtins.fetchTarball {
url = "https://hackage.haskell.org/package/http-api-data-0.4.3/http-api-data-0.4.3.tar.gz";
# sha256 = "...";
}) {};
lucid =
self.callCabal2nix "lucid" (builtins.fetchTarball {
url = "https://hackage.haskell.org/package/lucid-2.11.0/lucid-2.11.0.tar.gz";
# sha256 = "...";
}) {};
unagi-chan =
pkgs.haskell.lib.dontCheck (self.callCabal2nix "unagi-chan" (builtins.fetchTarball {
url = "https://hackage.haskell.org/package/unagi-chan-0.4.1.4/unagi-chan-0.4.1.4.tar.gz";
# sha256 = "...";
}) {});
warp =
pkgs.haskell.lib.dontCheck (self.callCabal2nix "warp" (builtins.fetchTarball {
url = "https://hackage.haskell.org/package/warp-3.3.20/warp-3.3.20.tar.gz";
# sha256 = "...";
}) {});
};
};

okapi =
okapiPkgs.callCabal2nix "okapi" (builtins.fetchTarball {
url = "https://hackage.haskell.org/package/okapi-0.1.0.2/okapi-0.1.0.2.tar.gz";
# sha256 = "...";
}) {};
# FOR BUILDING OKAPI END #

# Dynamic derivation for PostgREST
postgrest =
pkgs.haskell.packages."${compiler}".callCabal2nix name src { };
pkgs.haskell.packages."${compiler}".callCabal2nix name src { inherit okapi; };

# Function that derives a fully static Haskell package based on
# nh2/static-haskell-nix
Expand Down
2 changes: 1 addition & 1 deletion postgrest.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ library
, mtl >= 2.2.2 && < 2.3
, network >= 2.6 && < 3.2
, network-uri >= 2.6.1 && < 2.8
, okapi
, okapi == 0.1.0.2
, optparse-applicative >= 0.13 && < 0.17
, parsec >= 3.1.11 && < 3.2
, protolude >= 0.3 && < 0.4
Expand Down
3 changes: 1 addition & 2 deletions stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ extra-deps:
- wai-extra-3.1.8@sha256:bf3dbe8f4c707b502b2a88262ed71c807220651597b76b56983f864af6197890,7280
- wai-logger-2.3.7@sha256:19a0dc5122e22d274776d80786fb9501956f5e75b8f82464bbdad5604d154d82,1671
- warp-3.3.19@sha256:c6a47029537d42844386170d732cdfe6d85b2f4279bbaefdd9b50caff6faeebb,10910
- git: https://github.com/MonadicSystems/okapi.git
commit: 2933bdf03b94bdddfae9ce9c1945e50205011907
- okapi-0.1.0.2@sha256:b189d31f027deb7b1dd56910640c4abd700a88857ea4da51d234890aea189b95,2610
12 changes: 4 additions & 8 deletions stack.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,12 @@ packages:
original:
hackage: warp-3.3.19@sha256:c6a47029537d42844386170d732cdfe6d85b2f4279bbaefdd9b50caff6faeebb,10910
- completed:
name: okapi
version: 0.1.0.0
git: https://github.com/MonadicSystems/okapi.git
hackage: okapi-0.1.0.2@sha256:b189d31f027deb7b1dd56910640c4abd700a88857ea4da51d234890aea189b95,2610
pantry-tree:
size: 2594
sha256: 5c688f65fd3e9df3bc8d1a8d6ec8d905525ab46d3433e49d5ad55df578df11a0
commit: 2933bdf03b94bdddfae9ce9c1945e50205011907
size: 538
sha256: 12301f8806b7b9a7fdafe008ce223d7fdd15c1cc6cab8e77d817552eb9f52087
original:
git: https://github.com/MonadicSystems/okapi.git
commit: 2933bdf03b94bdddfae9ce9c1945e50205011907
hackage: okapi-0.1.0.2@sha256:b189d31f027deb7b1dd56910640c4abd700a88857ea4da51d234890aea189b95,2610
snapshots:
- completed:
size: 586069
Expand Down

0 comments on commit 92660ed

Please sign in to comment.