Skip to content

Commit 477b0f9

Browse files
author
idontgetoutmuch
committed
nixification
1 parent 30f1b1d commit 477b0f9

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

shell.nix

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{ nixpkgs ? import <nixpkgs> { config.allowUnfree = true; config.allowBroken = true; }, compiler ? "default", doBenchmark ? false }:
2+
3+
let
4+
5+
inherit (nixpkgs) pkgs;
6+
7+
f = { mkDerivation, accelerate, accelerate-fft
8+
, accelerate-llvm-native, base, Chart, Chart-cairo, Chart-diagrams
9+
, clock, diagrams-cairo, diagrams-lib, formatting, hedgehog, HUnit
10+
, lens-accelerate, stdenv, tasty, tasty-hedgehog, vector
11+
}:
12+
mkDerivation {
13+
pname = "chebApprox";
14+
version = "0.1.0.0";
15+
src = nixpkgs.fetchgit {
16+
url = https://github.com/DeifiliaTo/chebApprox;
17+
rev = "30f1b1d4ab33dfbcba061cdc3d6e224a0d1e7146";
18+
sha256 = "01w9yxx6djhgdhagdswkshdda6mkypvy0ajfrwyr0swrbkx6rrw5";
19+
};
20+
isLibrary = true;
21+
isExecutable = true;
22+
libraryHaskellDepends = [
23+
accelerate accelerate-llvm-native base clock formatting hedgehog
24+
tasty tasty-hedgehog vector
25+
];
26+
executableHaskellDepends = [
27+
accelerate accelerate-fft accelerate-llvm-native base Chart
28+
Chart-cairo Chart-diagrams diagrams-cairo diagrams-lib HUnit
29+
lens-accelerate
30+
];
31+
homepage = "https://github.com/DeifiliaTo/chebApprox";
32+
description = "Function approximation";
33+
license = stdenv.lib.licenses.bsd3;
34+
};
35+
36+
my-accelerate = pkgs.haskellPackages.accelerate.overrideAttrs (oldAttrs: rec {
37+
src = nixpkgs.fetchgit {
38+
url = https://github.com/tmcdonell/accelerate;
39+
rev = "a7b685352330ebf7d8794aed64663a9ee92dcdab";
40+
sha256 = "01w9yxx6djhgdhagdswkshdda6mkypvy0ajfrwyr0swrbkx6rrw5";
41+
};
42+
version = "1.3.0.0";
43+
doCheck = false;
44+
});
45+
46+
haskellPackages = if compiler == "default"
47+
then pkgs.haskellPackages
48+
else pkgs.haskell.packages.${compiler};
49+
50+
myHaskellPackages = haskellPackages.override {
51+
overrides = self: super: with pkgs.haskell.lib; {
52+
accelerate-llvm-native = dontCheck super.accelerate-llvm-native;
53+
accelerate-llvm-ptx = dontCheck super.accelerate-llvm-ptx;
54+
accelerate-fft = dontCheck super.accelerate-fft;
55+
accelerate = my-accelerate;
56+
};
57+
};
58+
59+
variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id;
60+
61+
drv = variant (myHaskellPackages.callPackage f {});
62+
63+
in
64+
65+
if pkgs.lib.inNixShell then drv.env else drv

0 commit comments

Comments
 (0)