-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathflake.nix
88 lines (74 loc) · 2.26 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
{
description = "NixOS-QChem flake";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nixConfig = {
extra-substituters = [ "https://nix-qchem.cachix.org" ];
extra-trusted-public-keys = [ "nix-qchem.cachix.org-1:ZjRh1PosWRj7qf3eukj4IxjhyXx6ZwJbXvvFk3o3Eos=" ];
allow-import-from-derivation = "true";
};
outputs = { self, nixpkgs, ... }:
let
qchemOvl = import ./overlay.nix;
system = "x86_64-linux";
pkgs = (import nixpkgs) {
inherit system;
overlays = [
qchemOvl
(final: prev: {
qchem = prev.qchem // {
turbomole = null;
cefine = null;
cfour = null;
gamess-us = null;
gaussview = null;
mrcc = null;
orca = null;
vmd = null;
mesa-qc = null;
mcdth = null;
nixGL = null;
};
})
];
config.allowUnfree = true;
config.qchem-config = (import ./cfg.nix) {
allowEnv = false;
optAVX = true;
};
};
inherit (pkgs) lib;
# Cleaned package set, i.e. packages that
# * build correctly
# * are not insecure (thus, remove all python2 packages)
pkgsClean = with lib;
let
buildingPkgs = filterAttrs
(k: v:
if (v ? meta.broken)
then !v.meta.broken && isDerivation v
else isDerivation v
)
pkgs.qchem;
securePackages = builtins.removeAttrs buildingPkgs [ "python2" ];
in
securePackages;
in
{
packages."${system}" = pkgsClean;
hydraJobs."${system}" = pkgsClean;
checks."${system}" = with lib; filterAttrs (n: isDerivation) pkgs.qchem.tests;
formatter."${system}" = pkgs.nixpkgs-fmt;
devShells."${system}".default = with pkgs; mkShell {
buildInputs = [
self.formatter."${system}"
statix
];
};
overlays = {
qchem = qchemOvl;
qchem' = import ./default.nix;
pythonQchem = import ./pythonPackages.nix pkgs.config.qchem-config.prefix pkgs.config.qchem-config pkgs nixpkgs;
default = self.overlays.qchem;
};
};
}