Be able to pass doOptimize/doProfiling flags to nix build

This commit is contained in:
Domen Kožar 2018-11-20 07:45:12 +00:00
parent 3c04c87ece
commit ef3bc04a7c
No known key found for this signature in database
GPG Key ID: C2FFBCAFD2C24246
3 changed files with 10 additions and 3 deletions

View File

@ -2,6 +2,10 @@
, doBenchmark ? false
, doTracing ? false
# enables GHC optimizations for production use
, doOptimize ? false
# enables profiling support in GHC
, doProfiling ? false
, doStrict ? false
, rev ? "b37872d4268164614e3ecef6e1f730d48cf5a90f"
@ -70,7 +74,8 @@ drv = haskellPackages.developPackage {
pkgs.haskell.packages.${compiler}.cabal-install
];
enableLibraryProfiling = false;
enableLibraryProfiling = doProfiling;
enableExecutableProfiling = doProfiling;
testHaskellDepends = attrs.testHaskellDepends ++
[ pkgs.nix
@ -88,6 +93,7 @@ drv = haskellPackages.developPackage {
configureFlags =
pkgs.stdenv.lib.optional doTracing "--flags=tracing"
++ pkgs.stdenv.lib.optional doOptimize "--flags=optimize"
++ pkgs.stdenv.lib.optional doStrict "--ghc-options=-Werror";
passthru = {

View File

@ -2,7 +2,7 @@
--
-- see: https://github.com/sol/hpack
--
-- hash: 07b6631da5bfe4929607211146ef8fdde38ea28d4aece34188af8e33d0287e5e
-- hash: bd9c8bad70af6e6bdc23b53988448061d7ab6aaee6054beb9d0f696e717f8a3c
name: hnix
version: 0.5.2
@ -573,7 +573,7 @@ executable hnix
Paths_hnix
hs-source-dirs:
main
ghc-options: -Wall
ghc-options: -Wall -rtsopts
build-depends:
aeson
, base >=4.9 && <5

View File

@ -155,6 +155,7 @@ executables:
hnix:
source-dirs: main
main: Main.hs
ghc-options: -rtsopts
dependencies:
- hnix
- aeson