Skip to content

Commit 17e6dfc

Browse files
committed
destroy Stack nix impl.
1 parent ccb26b6 commit 17e6dfc

File tree

4 files changed

+42
-82
lines changed

4 files changed

+42
-82
lines changed

cabal-shell.nix

Lines changed: 0 additions & 16 deletions
This file was deleted.

default.nix

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
1+
{ mkDerivation, ad, aeson, base, bytestring, containers
2+
, deepseq, directory, filepath, lib, process, random
3+
, raw-strings-qq, split, tasty, tasty-expected-failure
4+
, tasty-golden, tasty-hunit, temporary, which, pkgs
5+
}:
16
let
2-
sources = import nix/sources.nix {};
3-
haskell-nix = (import sources."haskell.nix" {});
4-
nixpkgs = haskell-nix.pkgs;
5-
gitignore = (import sources."gitignore.nix" {
6-
inherit (nixpkgs) lib;
7-
}).gitignoreSource;
8-
9-
src = nixpkgs.lib.cleanSourceWith {
10-
name = "matplotlib";
11-
src = gitignore ./.;
12-
};
7+
python = pkgs.python3.withPackages (p: with p; [
8+
matplotlib
9+
numpy
10+
scipy
11+
]);
1312
in
14-
nixpkgs.haskell-nix.stackProject {
15-
inherit src;
16-
modules = [({pkgs, ...}: {
17-
packages.matplotlib.components.library.build-tools =
18-
[ pkgs.buildPackages.python39Packages.matplotlib
19-
pkgs.buildPackages.python39Packages.scipy
20-
pkgs.buildPackages.texlive.combined.scheme-small ];
21-
packages.matplotlib.components.tests.matplotlib-test.build-tools =
22-
[ pkgs.buildPackages.python39Packages.matplotlib
23-
pkgs.buildPackages.python39Packages.scipy
24-
pkgs.buildPackages.texlive.combined.scheme-small ];
25-
doHaddock = false;
26-
})];
13+
mkDerivation {
14+
pname = "matplotlib";
15+
version = "0.7.7";
16+
src = ./.;
17+
libraryHaskellDepends = [
18+
aeson base bytestring containers deepseq filepath process split
19+
temporary
20+
];
21+
testHaskellDepends = [
22+
ad base bytestring directory process random raw-strings-qq split
23+
tasty tasty-expected-failure tasty-golden tasty-hunit temporary
24+
];
25+
librarySystemDepends = [ python which ];
26+
testSystemDepends = [ python which ];
27+
homepage = "https://github.com/abarbu/matplotlib-haskell";
28+
description = "Bindings to Matplotlib; a Python plotting library";
29+
license = lib.licenses.bsd3;
2730
}

default2.nix

Lines changed: 0 additions & 30 deletions
This file was deleted.

shell.nix

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
(import ./default.nix).shellFor {
2-
tools = {
3-
cabal = "latest";
4-
hpack = "latest";
5-
hlint = "latest";
6-
ormolu = "latest";
7-
haskell-language-server = "latest";
8-
};
1+
{ nixpkgs ? import <nixpkgs> {}
2+
, compiler ? "default"
3+
, doBenchmark ? false }:
94

10-
# Prevents cabal from choosing alternate plans, so that
11-
# *all* dependencies are provided by Nix.
12-
exactDeps = true;
13-
}
5+
let
6+
inherit (nixpkgs) pkgs;
7+
haskellPackages = if compiler == "default"
8+
then pkgs.haskellPackages
9+
else pkgs.haskell.packages.${compiler};
10+
11+
variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id;
12+
matplotlib = import ./default.nix;
13+
drv = variant (haskellPackages.callPackage matplotlib {});
14+
15+
in
16+
if pkgs.lib.inNixShell then drv.env else drv

0 commit comments

Comments
 (0)