1# CAUTION! a spelling mistake in arg string is ignored silently.
4# nix-shell --argstr compiler "ghc865"
8 import (builtins.fetchTarball https://github.com/NixOS/nixpkgs/archive/refs/tags/21.05.tar.gz)
11, c2nix ? "" # cabal2nix CLI options
13#, sources ? [] # e.g. [./. ./benchmark]
14#, hdeps ? [] # e.g. [time, mtl]
15#, deps ? [] # e.g. [SDL2]
18 if compiler == "default"
19 then nixpkgs.haskellPackages
20 else nixpkgs.haskell.packages.${compiler};
22 # we can possibly avoid adding our package to HaskellPackages like
23 # in the case of nix-shell for a single package?
24 mkPackage = super: pkg: path: opts: inShell:
25 let orig = super.callCabal2nixWithOptions pkg path opts {};
27 # Avoid copying the source directory to nix store by using
29 then orig.overrideAttrs (oldAttrs: { src = null; })
32 flags = "--benchmark --flag fusion-plugin --flag doctests" + " " + c2nix;
34 mkHaskellPackages = inShell:
35 haskellPackages.override {
36 # We could disbale doCheck on all like this, but it would make the
37 # whole world rebuild, we can't use the binary cache
38 #packageSetConfig = self: super: {
39 # mkDerivation = drv: super.mkDerivation (drv // {
43 overrides = self: super:
44 with nixpkgs.haskell.lib;
46 streamly = mkPackage super "streamly" ./. flags inShell;
48 mkPackage super "streamly-benchmarks"
49 ./benchmark flags inShell;
51 mkPackage super "streamly-tests"
54 mkPackage super "streamly-docs"
58 super.callHackageDirect
59 { pkg = "fusion-plugin";
61 sha256 = "073wbhdxj1sh5160blaihbzkkhabs8s71pqhag16lvmgbb7a3hla";
65 super.callHackageDirect
66 { pkg = "unicode-data";
68 sha256 = "14crb68g79yyw87fgh49z2fn4glqx0zr53v6mapihaxzkikhkkc3";
72 # super.callHackageDirect
73 # { pkg = "tasty-bench";
75 # sha256 = "052vd87dcik77x6nfbivdibyxyd3byqy4akchr1mrz0hd5ll8apg";
79 # super.callHackageDirect
82 # sha256 = "0g1280gcpcvjbmyk83jv3y9gs2z7fvmcagi9rfs8c9x036nvjq6c";
85 # Example to Use a different version of a package
86 #QuickCheck = self.QuickCheck_2_14;
88 # Example to disable tests if tests fail or take too long
89 # or to use different configure flags if needed
91 # XXX We need the ability to disable doCheck on all
92 # those packages that are being built locally and
93 # not fetched from the cache. Running tests could do
94 # nasty things to the machine e.g. some tests even
95 # listen for incoming connections on the network.
97 # super.selective.overrideAttrs (oldAttrs:
100 # oldAttrs.configureFlags ++ ["--disable-tests"];
105 drv = mkHaskellPackages true;
107 shell = drv.shellFor {
110 p.streamly-benchmarks
114 # some dependencies of hoogle fail to build with quickcheck-2.14
115 # We should use hoogle as external tool instead of building it here
118 # XXX On macOS cabal2nix does not seem to generate a dependency on
121 if builtins.currentSystem == "x86_64-darwin"
122 then [nixpkgs.darwin.apple_sdk.frameworks.Cocoa]
124 # Use a better prompt
126 export CABAL_DIR="$(pwd)/.cabal.nix"
127 cabal user-config update -a "jobs: 1"
128 if test -n "$PS_SHELL"
130 export PS1="$PS_SHELL\[$bldred\](nix:streamly)\[$txtrst\] "
134in if nixpkgs.lib.inNixShell
136 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