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 " + 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"
58 # Example to Use a different version of a package
59 #QuickCheck = self.QuickCheck_2_14;
61 # Example to disable tests if tests fail or take too long
62 # or to use different configure flags if needed
64 # XXX We need the ability to disable doCheck on all
65 # those packages that are being built locally and
66 # not fetched from the cache. Running tests could do
67 # nasty things to the machine e.g. some tests even
68 # listen for incoming connections on the network.
70 # super.selective.overrideAttrs (oldAttrs:
73 # oldAttrs.configureFlags ++ ["--disable-tests"];
78 drv = mkHaskellPackages true;
80 shell = drv.shellFor {
86 # some dependencies of hoogle fail to build with quickcheck-2.14
87 # We should use hoogle as external tool instead of building it here
90 # XXX On macOS cabal2nix does not seem to generate a dependency on
93 if builtins.currentSystem == "x86_64-darwin"
94 then [nixpkgs.darwin.apple_sdk.frameworks.Cocoa]
98 if test -n "$PS_SHELL"
100 export PS1="$PS_SHELL\[$bldred\](nix)\[$txtrst\] "
104in if nixpkgs.lib.inNixShell
106 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