-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.nix
90 lines (77 loc) · 2.05 KB
/
build.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
78
79
80
81
82
83
84
85
86
87
88
89
90
{ pkgs ? import <nixpkgs> {}, pythonPackages ? "python3Packages" }:
rec {
package = pythonPackages.buildPythonPackage rec {
pname = "dftfit";
version = "master";
disabled = pythonPackages.isPy27;
src = builtins.filterSource
(path: _: !builtins.elem (builtins.baseNameOf path) [".git" "result" "docs"])
./.;
buildInputs = with pythonPackages; [
pytestrunner
pkgs.lammps
];
checkInputs = with pythonPackages; [
pytest
pytestcov
pytest-benchmark
pkgs.openssh
pkgs.lammps
];
propagatedBuildInputs = with pythonPackages; [
pymatgen
marshmallow
pyyaml
pygmo
pandas
scipy
numpy
scikitlearn
lammps-cython
pymatgen-lammps
];
checkPhase = ''
pytest -m "not long" \
--ignore tests/integration/test_md_lammps_cython_calculator.py \
--ignore tests/integration/test_dftfit_lammps_cython_calculator.py \
'';
meta = with pkgs; {
description = "Ab-Initio Molecular Dynamics Potential Development";
homepage = https://github.com/costrouc/dftfit;
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ costrouc ];
};
};
docs = pkgs.stdenv.mkDerivation {
name = "dftfit-docs";
version = "master";
src = builtins.filterSource
(path: _: !builtins.elem (builtins.baseNameOf path) [".git" "result"])
./.;
buildInputs = with pythonPackages; [
package
sphinx
sphinx_rtd_theme
];
buildPhase = ''
cd docs;
sphinx-apidoc -o source/ ../dftfit
sphinx-build -b html -d build/doctrees . build/html
'';
installPhase = ''
mkdir -p $out
cp -r build/html/* $out
touch $out/.nojekyll
'';
};
docker = pkgs.dockerTools.buildLayeredImage {
name = "dftfit-docker";
tag = "latest";
contents = [
(pythonPackages.python.withPackages
(ps: with ps; [ jupyterlab package ipython ]))
];
config.Cmd = [ "ipython" ];
maxLayers = 120;
};
}