on 43dda21 help sign in
157 lines 6.4 kB history raw
1let
2 nixpkgsPath_21_11 =
3 "https://github.com/NixOS/nixpkgs/archive/refs/tags/21.11.tar.gz";
4 nixpkgsDefault = import (builtins.fetchTarball nixpkgsPath_21_11) { };
5in
6{
7 nixpkgs ? nixpkgsDefault
8, compiler ? "default"
9}:
10let haskellPackages =
11 if compiler == "default"
12 then nixpkgs.haskellPackages
13 else nixpkgs.haskell.packages.${compiler};
15 mkPackage = super: pkg: path: opts: inShell:
16 let orig = super.callCabal2nixWithOptions pkg path opts {};
17 in if inShell
18 # Avoid copying the source directory to nix store by using
19 # src = null.
20 then orig.overrideAttrs (oldAttrs: { src = null; })
21 else orig;
23 mkPkgGit = super: gitSrc: rev: name:
24 let
25 src = builtins.fetchGit {
26 url = gitSrc;
27 rev = rev;
28 };
29 in super.callCabal2nix name src { };
31 mkPkgGitRef = super: gitSrc: rev: ref: name:
32 let
33 src = builtins.fetchGit {
34 url = gitSrc;
35 rev = rev;
36 ref = ref;
37 };
38 in super.callCabal2nix name src { };
40 mkHaskellPackages = inShell:
41 haskellPackages.override {
42 overrides = self: super:
43 with nixpkgs.haskell.lib;
44 {
45 report = mkPackage super "streamly-test-report" ./. "" inShell;
47 bench-report =
48 nixpkgs.haskell.lib.overrideCabal
49 (let src = fetchGit {
50 url = "git@github.com:composewell/bench-report.git";
51 rev = "c11f79b202d812efe4d1785e0537f1ad4d947bfe";
52 }; in super.callCabal2nix "bench-report" src {})
53 (old:
54 { enableLibraryProfiling = false;
55 doHaddock = false;
56 });
58# streamly-coreutils = let
59# src = "git@github.com:composewell/streamly-coreutils.git";
60# rev = "a12756efe24bbf303f2f6d66a95426c7657d297b";
61# in mkPkgGit super src rev "streamly-coreutils";
63 streamly-coreutils =
64 nixpkgs.haskell.lib.overrideCabal
65 (let src = fetchGit {
66 url = "git@github.com:composewell/streamly-coreutils.git";
67 rev = "8fa4a3ebedb3f970f64b7d78d8ab340b0f771abe";
68 }; in super.callCabal2nix "streamly-coreutils" src {})
69 (old:
70 { librarySystemDepends =
71 if builtins.currentSystem == "x86_64-darwin"
72 then [nixpkgs.darwin.apple_sdk.frameworks.Cocoa]
73 else [];
74 #enableLibraryProfiling = false;
75 doHaddock = false;
76 doCheck = false;
77 });
79 streamly-shell = let
80 src = "https://github.com/composewell/streamly-shell.git";
81 rev = "7d77ddc0c06aec21fbbfd1b920ec4f58da654a1b";
82 in mkPkgGit super src rev "streamly-shell";
84 streamly-process = let
85 src = "https://github.com/composewell/streamly-process.git";
86 rev = "a56ef61c1208c2d564a526eba315d903c0b4af2c";
87 in nixpkgs.haskell.lib.dontCheck
88 (mkPkgGit super src rev "streamly-process");
90 #streamly-process = nixpkgs.haskell.lib.dontCheck
91 # (super.callHackageDirect {
92 # pkg = "streamly-process";
93 # ver = "0.1.0";
94 # sha256 = "01nxisqfmn29fbirdsx71sfjp2rdqwrf469qyjcql2d11i1bxn94";
95 # } { });
97 # streamly = super.callHackageDirect {
98 # pkg = "streamly";
99 # ver = "0.8.0";
100 # sha256 = "0vy2lkljizlhpbpbybmg9jcmj2g4s1aaqd2dzy5c0y0n4rgwxask";
101 # } { };
102 streamly =
103 nixpkgs.haskell.lib.overrideCabal
104 #(super.callHackageDirect
105 # { pkg = "streamly";
106 # ver = "0.8.2";
107 # sha256 = "sha256-CjFq9SCdbgLZa7NqOE4OtC8OaFg4vK8VmIDjGU5rGko=";
108 # } {})
109 (let src = fetchGit {
110 url = "git@github.com:composewell/streamly.git";
111 rev = "a849812d9960d5b7868e770156ab774ee8f70157";
112 }; in super.callCabal2nix "streamly" src {})
113 (old:
114 { librarySystemDepends =
115 if builtins.currentSystem == "x86_64-darwin"
116 then [nixpkgs.darwin.apple_sdk.frameworks.Cocoa]
117 else [];
118 #enableLibraryProfiling = false;
119 doHaddock = false;
120 });
122 streamly-core =
123 nixpkgs.haskell.lib.overrideCabal
124 (let src = fetchGit {
125 url = "git@github.com:composewell/streamly.git";
126 rev = "a849812d9960d5b7868e770156ab774ee8f70157";
127 }; in super.callCabal2nix "streamly-core" "${src}/core" {})
128 (old:
129 { librarySystemDepends =
130 if builtins.currentSystem == "x86_64-darwin"
131 then [nixpkgs.darwin.apple_sdk.frameworks.Cocoa]
132 else [];
133 #enableLibraryProfiling = false;
134 doHaddock = false;
135 });
137 };
138 };
140 drv = mkHaskellPackages true;
142 shell = drv.shellFor {
143 packages = p:
144 [ p.report
145 ];
146 # Use a better prompt
147 shellHook = ''
148 export CABAL_DIR="$(pwd)/.cabal.nix"
149 if test -n "$PS_SHELL"
150 then
151 export PS1="$PS_SHELL\[$bldred\](nix)\[$txtrst\] "
152 fi
153 '';
154 };
155in if nixpkgs.lib.inNixShell
156 then shell
157 else (mkHaskellPackages false).streamly-test-report