Created
April 4, 2019 18:25
-
-
Save apeyroux/457efc911ab97d52cafb57797bf0a59a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ nixpkgs ? (import <nixpkgs> {}).pkgsMusl, compiler ? "default", doBenchmark ? false }: | |
let | |
inherit (nixpkgs) pkgs; | |
f = { mkDerivation, aeson, base, bytestring, directory, filepath | |
, hasql, optparse-applicative, stdenv, text, time | |
}: | |
mkDerivation { | |
pname = "atrc-audit"; | |
version = "0.1.0.0"; | |
src = ./.; | |
isLibrary = false; | |
isExecutable = true; | |
executableHaskellDepends = [ | |
aeson base bytestring directory hasql filepath optparse-applicative | |
text time | |
]; | |
license = stdenv.lib.licenses.bsd3; | |
enableSharedExecutables = false; | |
enableSharedLibraries = false; | |
configureFlags = [ | |
"--ghc-option=-optl=-pthread" | |
"--ghc-option=-optl=-static -fPIC" | |
"--ghc-option=-optl=-L${pkgs.gmp6.override { withStatic = true; }}/lib" | |
"--ghc-option=-optl=-L${pkgs.zlib.static}/lib" | |
"--ghc-option=-optl=-L${pkgs.glibc.static}/lib" | |
]; | |
}; | |
haskellPackages = if compiler == "default" | |
then pkgs.haskellPackages | |
else pkgs.haskell.packages.${compiler}; | |
variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id; | |
drv = variant (haskellPackages.callPackage f {}); | |
in | |
if pkgs.lib.inNixShell then drv.env else drv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment