* Include modifications to nixpkgs and static-haskell-nix as patches. * use the patched static-haskell-nix version * Add cachix postgrest
This commit is contained in:
+30
-6
@@ -2,6 +2,9 @@ let
|
||||
name =
|
||||
"postgrest";
|
||||
|
||||
compiler =
|
||||
"ghc883";
|
||||
|
||||
# PostgREST source files, filtered based on the rules in the .gitignore files
|
||||
# and file extensions. We want to include as litte as possible, as the files
|
||||
# added here will increase the space used in the Nix store and trigger the
|
||||
@@ -11,10 +14,13 @@ let
|
||||
(pkgs.gitignoreSource ./.)
|
||||
[ ".cabal" ".hs" ".lhs" "LICENSE" ];
|
||||
|
||||
# Commit of the Nixpkgs repository that we want to use.
|
||||
nixpkgsVersion =
|
||||
import nix/nixpkgs-version.nix;
|
||||
|
||||
pinnedPkgs =
|
||||
# Nix files that describe the Nixpkgs repository. We evaluate the expression
|
||||
# using `import` below.
|
||||
nixpkgs =
|
||||
builtins.fetchTarball {
|
||||
url = "https://github.com/nixos/nixpkgs/archive/${nixpkgsVersion.rev}.tar.gz";
|
||||
sha256 = nixpkgsVersion.tarballHash;
|
||||
@@ -27,8 +33,9 @@ let
|
||||
(import nix/overlays/haskell-packages)
|
||||
];
|
||||
|
||||
# Evaluated expression of the Nixpkgs repository.
|
||||
pkgs =
|
||||
import pinnedPkgs { inherit overlays; };
|
||||
import nixpkgs { inherit overlays; };
|
||||
|
||||
postgresqlVersions =
|
||||
[
|
||||
@@ -40,22 +47,39 @@ let
|
||||
pkgs.postgresql_9_4
|
||||
];
|
||||
|
||||
patches =
|
||||
pkgs.callPackage nix/patches {};
|
||||
|
||||
# Base dynamic derivation for the PostgREST package.
|
||||
drv =
|
||||
pkgs.haskellPackages.callCabal2nix name src {};
|
||||
|
||||
# Static derivation for the PostgREST executable.
|
||||
drvStatic =
|
||||
import nix/static { inherit nixpkgs name src compiler patches; };
|
||||
|
||||
lib =
|
||||
pkgs.haskell.lib;
|
||||
in
|
||||
rec {
|
||||
inherit pkgs pinnedPkgs;
|
||||
inherit nixpkgs pkgs;
|
||||
|
||||
# Derivation for the PostgREST Haskell package, including the executable,
|
||||
# libraries and documentation. We disable running the test suite on Nix
|
||||
# builds, as they require a database to be set up.
|
||||
postgrestWithLib =
|
||||
pkgs.haskell.lib.dontCheck drv;
|
||||
lib.dontCheck drv;
|
||||
|
||||
# Derivation for just the PostgREST binary, where we strip all dynamic
|
||||
# libraries and documentation, leaving only the executable.
|
||||
# libraries and documentation, leaving only the executable. Note that the
|
||||
# executable is static with regards to Haskell libraries, but not system
|
||||
# libraries like glibc and libpq.
|
||||
postgrest =
|
||||
pkgs.haskell.lib.justStaticExecutables postgrestWithLib;
|
||||
lib.justStaticExecutables postgrestWithLib;
|
||||
|
||||
# Static executable.
|
||||
postgrestStatic =
|
||||
lib.justStaticExecutables (lib.dontCheck drvStatic);
|
||||
|
||||
# Environment in which PostgREST can be built with cabal, useful e.g. for
|
||||
# defining a shell for nix-shell.
|
||||
|
||||
Reference in New Issue
Block a user