1# CAUTION! a spelling mistake in arg string is ignored silently.
3# To build the chart executable for running bench.sh use:
4# nix-shell --argstr c2nix "--flag dev" --run "cabal build chart --flag dev"
7# nix-shell --argstr compiler "ghc865"
11 import (builtins.fetchTarball https://github.com/composewell/nixpkgs/archive/01dd2b4e738.tar.gz)
12 # fusion-plugin is marked as broken
13 { config.allowBroken = true;}
15, c2nix ? "" # cabal2nix CLI options
17#, sources ? [] # e.g. [./. ./benchmark]
18#, hdeps ? [] # e.g. [time, mtl]
19#, deps ? [] # e.g. [SDL2]
22 if compiler == "default"
23 then nixpkgs.haskellPackages
24 else nixpkgs.haskell.packages.${compiler};
26 # we can possibly avoid adding our package to HaskellPackages like
27 # in the case of nix-shell for a single package?
28 mkPackage = super: pkg: path: opts: inShell:
29 let orig = super.callCabal2nixWithOptions pkg path opts {};
31 # Avoid copying the source directory to nix store by using
33 then orig.overrideAttrs (oldAttrs: { src = null; })
36 flags = "--benchmark --flag fusion-plugin --flag doctests" + " " + c2nix;
38 mkHaskellPackages = inShell:
39 haskellPackages.override {
40 # We could disbale doCheck on all like this, but it would make the
41 # whole world rebuild, we can't use the binary cache
42 #packageSetConfig = self: super: {
43 # mkDerivation = drv: super.mkDerivation (drv // {
47 overrides = self: super:
48 with nixpkgs.haskell.lib;
50 streamly = mkPackage super "streamly" ./. flags inShell;
52 mkPackage super "streamly-benchmarks"
53 ./benchmark flags inShell;
55 mkPackage super "streamly-tests"
59 super.callHackageDirect
60 { pkg = "fusion-plugin";
62 sha256 = "1g7j50wa7ffyizv6fdnr09dr4w7bc0hskb46h7y0paw6rh9yz4zj";
65 # Example to Use a different version of a package
66 #QuickCheck = self.QuickCheck_2_14;
68 # Example to disable tests if tests fail or take too long
69 # or to use different configure flags if needed
71 # XXX We need the ability to disable doCheck on all
72 # those packages that are being built locally and
73 # not fetched from the cache. Running tests could do
74 # nasty things to the machine e.g. some tests even
75 # listen for incoming connections on the network.
77 # super.selective.overrideAttrs (oldAttrs:
80 # oldAttrs.configureFlags ++ ["--disable-tests"];
85 drv = mkHaskellPackages true;
87 shell = drv.shellFor {
93 # some dependencies of hoogle fail to build with quickcheck-2.14
94 # We should use hoogle as external tool instead of building it here
97 # XXX On macOS cabal2nix does not seem to generate a dependency on
100 if builtins.currentSystem == "x86_64-darwin"
101 then [nixpkgs.darwin.apple_sdk.frameworks.Cocoa]
103 # Use a better prompt
105 if test -n "$PS_SHELL"
107 export PS1="$PS_SHELL\[$bldred\](nix)\[$txtrst\] "
111in if nixpkgs.lib.inNixShell
113 else (mkHaskellPackages false).streamly
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list