forked from BlauGroup/HiPRGen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
77 lines (66 loc) · 1.92 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{
description = "Multi node reaction network generator";
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixos-21.05;
RNMC.url = github:BlauGroup/RNMC;
flake-compat = {
url = github:edolstra/flake-compat;
flake = false;
};
};
outputs = { self, nixpkgs, RNMC, flake-compat }:
let
HiPRGen = systemString:
with import nixpkgs { system = systemString; };
with python38Packages;
buildPythonPackage {
pname = "HiPRGen";
version = "0.2";
src = ./.;
checkInputs = [
pymatgen
monty
openbabel-bindings
pygraphviz
mpi4py
pycairo
mpi
(builtins.getAttr systemString RNMC.defaultPackage)
sqlite
openssh # needed for correct MPI functioning
];
checkPhase = "python test.py 2";
};
genericDevShell = systemString: installHiPRGen:
with import nixpkgs { system = systemString; };
mkShell {
buildInputs = with python38Packages; [
pymatgen
monty
openbabel-bindings
pygraphviz
pyright
mpi4py
pycairo
(if installHiPRGen then (HiPRGen systemString) else null)
texlive.combined.scheme-small
mpi
(sqlite.override { interactive = true; })
(builtins.getAttr systemString RNMC.defaultPackage)
];
};
in {
devShell = {
x86_64-linux = genericDevShell "x86_64-linux" false;
x86_64-darwin = genericDevShell "x86_64-darwin" false;
};
defaultPackage = {
x86_64-linux = HiPRGen "x86_64-linux";
x86_64-darwin = HiPRGen "x86_64-darwin";
};
checks = {
x86_64-linux.tests = HiPRGen "x86_64-linux";
x86_64-darwin.tests = HiPRGen "x86_64-darwin";
};
};
}