Created
March 22, 2021 14:40
-
-
Save idontgetoutmuch/88a3a7fc4ad4e4e7326fa313bdf2e172 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ nixpkgs ? import <nixpkgs> { config.allowBroken = true; }, compiler ? "default", doBenchmark ? false }: | |
let | |
inherit (nixpkgs) pkgs; | |
f = { mkDerivation, accelerate, accelerate-fft | |
, accelerate-llvm-native, base, stdenv, mwc-random-accelerate | |
, random-fu, hmatrix | |
, accelerate-blas | |
}: | |
mkDerivation { | |
pname = "lorri-test"; | |
version = "0.1.0.0"; | |
src = ./.; | |
isLibrary = false; | |
isExecutable = true; | |
executableHaskellDepends = [ | |
accelerate | |
accelerate-llvm-native | |
mwc-random-accelerate | |
hmatrix | |
accelerate-blas | |
random-fu | |
base | |
]; | |
homepage = "https://github.com/idontgetoutmuch/whatever"; | |
description = "Whatever"; | |
license = stdenv.lib.licenses.bsd3; | |
}; | |
my-accelerate-blas = pkgs.haskellPackages.accelerate-blas.overrideAttrs (oldAttrs: rec { | |
configureFlags = "-f -llvm-ptx"; | |
}); | |
haskellPackages = if compiler == "default" | |
then pkgs.haskellPackages | |
else pkgs.haskell.packages.${compiler}; | |
myHaskellPackages = haskellPackages.override { | |
overrides = self: super: with pkgs.haskell.lib; { | |
accelerate-llvm-native = dontCheck super.accelerate-llvm-native; | |
accelerate-blas = dontCheck my-accelerate-blas; | |
}; | |
}; | |
variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id; | |
drv = variant (myHaskellPackages.callPackage f {}); | |
in | |
if pkgs.lib.inNixShell then drv.env else drv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment