Skip to content

Commit

Permalink
Upated Nix expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
basvandijk committed Sep 27, 2015
1 parent 922d690 commit 22fe25d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 31 deletions.
33 changes: 17 additions & 16 deletions scientific.nix
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
{ cabal, deepseq, hashable, QuickCheck, smallcheck, tasty
, tastyAntXml, tastyHunit, tastyQuickcheck, tastySmallcheck, text, vector
{ mkDerivation, base, bytestring, containers, deepseq, ghc-prim
, hashable, integer-gmp, QuickCheck, smallcheck, stdenv, tasty
, tasty-ant-xml, tasty-hunit, tasty-quickcheck, tasty-smallcheck
, text, vector
}:

cabal.mkDerivation (self: {
mkDerivation {
pname = "scientific";
version = "HEAD";
version = "0.3.4.0";
src = ./.;
buildDepends = [ deepseq hashable text ];
testDepends = [
QuickCheck smallcheck tasty tastyAntXml tastyHunit tastyQuickcheck
tastySmallcheck text vector
libraryHaskellDepends = [
base bytestring containers deepseq ghc-prim hashable integer-gmp
text vector
];
meta = {
homepage = "https://github.com/basvandijk/scientific";
description = "Numbers represented using scientific notation";
license = self.stdenv.lib.licenses.bsd3;
platforms = self.ghc.meta.platforms;
};
})
testHaskellDepends = [
base bytestring QuickCheck smallcheck tasty tasty-ant-xml
tasty-hunit tasty-quickcheck tasty-smallcheck text
];
homepage = "https://github.com/basvandijk/scientific";
description = "Numbers represented using scientific notation";
license = stdenv.lib.licenses.bsd3;
}
28 changes: 13 additions & 15 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default" }:

let
pkgs = import <nixpkgs> {};
haskellPackages = pkgs.haskellPackages.override {
extension = self: super: {
scientific = self.callPackage ./scientific.nix {};
};
};

in pkgs.myEnvFun {
name = haskellPackages.scientific.name;
buildInputs = [
(haskellPackages.ghcWithPackages (hs: ([
hs.cabalInstall
] ++ hs.scientific.propagatedNativeBuildInputs
++ hs.scientific.extraBuildInputs)))
];
}
inherit (nixpkgs) pkgs;

haskellPackages = if compiler == "default"
then pkgs.haskellPackages
else pkgs.haskell.packages.${compiler};

drv = haskellPackages.callPackage (import ./scientific.nix) {};

in

if pkgs.lib.inNixShell then drv.env else drv

0 comments on commit 22fe25d

Please sign in to comment.