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.11.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-core" ./core flags inShell;
50 mkPackage super "streamly-benchmarks"
51 ./benchmark flags inShell;
53 mkPackage super "streamly-tests"
56 mkPackage super "streamly-docs"
60 # super.callHackageDirect
61 # { pkg = "fusion-plugin";
63 # sha256 = "073wbhdxj1sh5160blaihbzkkhabs8s71pqhag16lvmgbb7a3hla";
67 super.callHackageDirect
68 { pkg = "unicode-data";
70 sha256 = "14crb68g79yyw87fgh49z2fn4glqx0zr53v6mapihaxzkikhkkc3";
73 tasty-bench = super.tasty-bench_0_3_1;
76 # super.callHackageDirect
77 # { pkg = "tasty-bench";
79 # sha256 = "0ixdxa7qwl4kck12gwvxg9kydhckjsi5drxcypr33jcdj771j7a4";
83 # super.callHackageDirect
86 # sha256 = "0g1280gcpcvjbmyk83jv3y9gs2z7fvmcagi9rfs8c9x036nvjq6c";
89 # Example to Use a different version of a package
90 #QuickCheck = self.QuickCheck_2_14;
92 # Example to disable tests if tests fail or take too long
93 # or to use different configure flags if needed
95 # XXX We need the ability to disable doCheck on all
96 # those packages that are being built locally and
97 # not fetched from the cache. Running tests could do
98 # nasty things to the machine e.g. some tests even
99 # listen for incoming connections on the network.
101 # super.selective.overrideAttrs (oldAttrs:
104 # oldAttrs.configureFlags ++ ["--disable-tests"];
109 drv = mkHaskellPackages true;
111 shell = drv.shellFor {
115 p.streamly-benchmarks
119 # some dependencies of hoogle fail to build with quickcheck-2.14
120 # We should use hoogle as external tool instead of building it here
123 # XXX On macOS cabal2nix does not seem to generate a dependency on
126 if builtins.currentSystem == "x86_64-darwin"
127 then [nixpkgs.darwin.apple_sdk.frameworks.Cocoa]
129 # Use a better prompt
131 export CABAL_DIR="$(pwd)/.cabal.nix"
132 #This is commented for hls to work with VSCode
133 #cabal user-config update -a "jobs: 1"
134 if test -n "$PS_SHELL"
136 export PS1="$PS_SHELL\[$bldred\](nix:streamly)\[$txtrst\] "
140in if nixpkgs.lib.inNixShell
142 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