|
| 1 | +{ |
| 2 | + description = "A flake for computational chemistry, based on NixOS-QChem"; |
| 3 | + |
| 4 | + inputs = { |
| 5 | + #qchem.url = "github:nix-qchem/nixos-qchem"; |
| 6 | + qchem.url = "../"; |
| 7 | + }; |
| 8 | + |
| 9 | + nixConfig = { |
| 10 | + extra-substituters = [ "https://nix-qchem.cachix.org" ]; |
| 11 | + |
| 12 | + allow-import-from-derivation = "true"; |
| 13 | + }; |
| 14 | + |
| 15 | + outputs = { self, qchem }: |
| 16 | + let |
| 17 | + # EDITME |
| 18 | + # Overlay to enable Gaussian support. Uncomment below in `pkgs` to enable. |
| 19 | + enableGaussian = final: prev: { |
| 20 | + qchem = prev.qchem // { |
| 21 | + gaussian = prev.callPackage "${qchem}/pkgs/apps/gaussian" { |
| 22 | + # Set a version |
| 23 | + version = "16c02"; |
| 24 | + |
| 25 | + # Either set optpath |
| 26 | + optpath = "/opt"; |
| 27 | + # or g16Root and g16Dir |
| 28 | + #g16Root = "/cluster/apps/gaussian/g16_c02"; |
| 29 | + #g16Dir = "/cluster/apps/gaussian/g16_c02/g16"; |
| 30 | + }; |
| 31 | + }; |
| 32 | + }; |
| 33 | + |
| 34 | + # EDITME |
| 35 | + # Disables unfree packages by default to avoid non-building packages, that |
| 36 | + # use unfree ones as dependencies, e.g. Pysisyphus or SHARC. |
| 37 | + # Comment out lines to enable the respective package. |
| 38 | + filterUnfree = final: prev: { |
| 39 | + qchem = prev.qchem // { |
| 40 | + turbomole = null; |
| 41 | + cefine = null; |
| 42 | + cfour = null; |
| 43 | + gamess-us = null; |
| 44 | + gaussview = null; |
| 45 | + mrcc = null; |
| 46 | + orca = null; |
| 47 | + vmd = null; |
| 48 | + mesa-qc = null; |
| 49 | + mcdth = null; |
| 50 | + nixGL = null; |
| 51 | + }; |
| 52 | + }; |
| 53 | + |
| 54 | + # EDITME |
| 55 | + # Python environment for computational chemistry. Add or remove packages |
| 56 | + # as needed. |
| 57 | + pyCompEnv = pkgs.qchem.python3.withPackages (ps: with ps; [ |
| 58 | + jupyterlab |
| 59 | + numpy |
| 60 | + scipy |
| 61 | + scikit-learn |
| 62 | + ase |
| 63 | + pyscf |
| 64 | + psi4 |
| 65 | + ]); |
| 66 | + |
| 67 | + system = "x86_64-linux"; |
| 68 | + |
| 69 | + pkgs = import qchem.inputs.nixpkgs { |
| 70 | + inherit system; |
| 71 | + |
| 72 | + # EDITME |
| 73 | + overlays = [ |
| 74 | + qchem.overlays.default |
| 75 | + filterUnfree |
| 76 | + # enableGaussian # Uncomment to enable Gaussian support |
| 77 | + ]; |
| 78 | + |
| 79 | + config = { |
| 80 | + allowUnfree = true; |
| 81 | + |
| 82 | + # EDITME |
| 83 | + qchem-config = { |
| 84 | + # Set to a GCC architecture to optimise packages for. |
| 85 | + # See https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html for options. |
| 86 | + optArch = "haswell"; |
| 87 | + |
| 88 | + # Set to an installation path of Gaussian/MatLab outside the Nix |
| 89 | + # store if you have one. Should have a directory structure like this: |
| 90 | + # "${optpath}/gaussian/g16/" |
| 91 | + # "${optpath}/matlab-R2024/" |
| 92 | + #optpath = "/opt"; |
| 93 | + |
| 94 | + # Set and uncomment if you have a MolPro license key. |
| 95 | + #licMolpro = "XXXX-XXXX-XXXX-XXXX"; |
| 96 | + |
| 97 | + # Set and uncomment if you have a Q-Chem license key file. |
| 98 | + #licQChem = "/path/to/qchem.lic"; |
| 99 | + |
| 100 | + # Uncomment if you have a server from which non-redistributable |
| 101 | + # software can be downloaded |
| 102 | + #srcurl = "http://myserver/nix-src/"; |
| 103 | + }; |
| 104 | + }; |
| 105 | + }; |
| 106 | + in |
| 107 | + { |
| 108 | + # EDITME |
| 109 | + # A shell to obtain via `nix develop` or DirEnv, useful to run |
| 110 | + # programs interactively. Contains a Python environment for computational |
| 111 | + # chemistry. See above. Add/remove packages as needed. |
| 112 | + devShells."${system}".default = with pkgs; mkShell { |
| 113 | + buildInputs = [ |
| 114 | + pyCompEnv |
| 115 | + pkgs.qchem.xtb |
| 116 | + ]; |
| 117 | + }; |
| 118 | + |
| 119 | + packages."${system}" = with pkgs.lib.attrsets; |
| 120 | + filterAttrs (_: val: isDerivation val) |
| 121 | + (pkgs.qchem // { |
| 122 | + inherit (pkgs) lammps lammps-mpi tachyon; |
| 123 | + }); |
| 124 | + }; |
| 125 | +} |
0 commit comments