forked from eljost/pysisyphus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
110 lines (92 loc) · 3.16 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
{
description = "Python suite for optimization of stationary points on ground- and excited states PES and determination of reaction paths";
inputs = {
qchem.url = "github:nix-qchem/nixos-qchem/master";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
flake-utils.url = "github:numtide/flake-utils";
nixBundlers.url = "github:NixOS/bundlers/master";
};
nixConfig = {
# Custom prompt in nix develop shell
bash-prompt = ''\[\e[0;1;38;5;215m\]pysisyphus\[\e[0;1m\]:\[\e[0;1;38;5;75m\]\w\[\e[0;1m\]$ \[\e[0m\]'';
extra-subtituters = [ "https://pysisyphus.cachix.org" ];
};
outputs = { self, qchem, flake-utils, nixBundlers, ... }:
flake-utils.lib.eachSystem [ "x86_64-linux" ]
(system:
let
pkgs = import qchem.inputs.nixpkgs {
inherit system;
overlays = [ qchem.overlays.default (import ./nix/overlay.nix) ];
config = {
allowUnfree = true;
qchem-config = {
optAVX = true;
allowEnv = false;
};
};
};
toSingularityImage = drv: pkgs.singularity-tools.buildImage {
name = drv.name;
contents = with pkgs; [
drv
bashInteractive
coreutils
findutils
gnused
which
];
diskSize = 40000;
memSize = 2000;
};
in
{
packages = {
default = self.packages."${system}".pysisyphus;
pysisyphus = pkgs.pysisyphus.override { };
pysisyphusOrca = self.packages."${system}".pysisyphus.override { enableOrca = true; };
pysisyphusTurbomole = self.packages."${system}".pysisyphus.override { enableTurbomole = true; };
pysisyphusFull = self.packages."${system}".pysisyphus.override {
enableOrca = true;
enableTurbomole = true;
enableCfour = true;
enableMolpro = true;
enableGamess = true;
};
};
devShells.default =
let
pythonEnv = pkgs.python3.withPackages (p: with p;
[ pip ]
++ p.pysisyphus.nativeBuildInputs
++ p.pysisyphus.buildInputs
++ p.pysisyphus.propagatedBuildInputs
);
in
pkgs.mkShell {
buildInputs = [
pkgs.nixpkgs-fmt
pkgs.black
pythonEnv
];
shellHook = ''
export PYSISRC=${pkgs.python3.pkgs.pysisyphus.passthru.pysisrc}
'';
};
bundlers = {
inherit toSingularityImage;
inherit (nixBundlers.bundlers."${system}") toArx toDEB toRPM toDockerImage;
default = self.bundlers."${system}".toArx;
};
formatter = pkgs.nixpkgs-fmt;
checks = {
inherit (self.packages."${system}") pysisyphus;
};
}) // {
overlays.default = import ./nix/overlay.nix;
hydraJobs = self.checks;
};
}