Skip to content

Commit

Permalink
flake: sanitise so that it passes nix flake check
Browse files Browse the repository at this point in the history
  • Loading branch information
sheepforce committed Mar 16, 2023
1 parent ac6e32c commit d7daa86
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 39 deletions.
77 changes: 51 additions & 26 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,29 @@

nixConfig.extra-substituters = [ "https://nix-qchem.cachix.org" ];

outputs = { self, nixpkgs } : let
lib = import "${nixpkgs}/lib";
outputs = { self, nixpkgs, ... }:
let
qchemOvl = import ./overlay.nix;

system = "x86_64-linux";

pkgs = (import nixpkgs) {
system = "x86_64-linux";
inherit system;
overlays = [
(import ./overlay.nix)
(self: super: { qchem = super.qchem // {
turbomole = null;
cefine = null;
cfour = null;
mrcc = null;
orca = null;
qdng = null;
vmd = null;
mesa-qc = null;
mcdth = null;
};})
qchemOvl
(final: prev: {
qchem = prev.qchem // {
turbomole = null;
cefine = null;
cfour = null;
mrcc = null;
orca = null;
qdng = null;
vmd = null;
mesa-qc = null;
mcdth = null;
};
})
];
config.allowUnfree = true;
config.qchem-config = (import ./cfg.nix) {
Expand All @@ -31,17 +36,37 @@
};
};

pkgsClean = with lib; filterAttrs (n: isDerivation) pkgs.qchem;
in {
lib = pkgs.lib;

overlays = {
qchem = import ./overlay.nix;
pythonQchem = import ./pythonPackages.nix pkgs.config.qchem-config.prefix pkgs.config.qchem-config pkgs nixpkgs;
default = self.overlays.qchem;
};
# 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;

packages."x86_64-linux" = pkgsClean;
hydraJobs."x86_64-linux" = pkgsClean;
checks."x86_64-linux" = with lib; filterAttrs (n: isDerivation) pkgs.qchem.tests;
};
checks."${system}" = with lib; filterAttrs (n: isDerivation) pkgs.qchem.tests;


overlays = {
qchem = qchemOvl;
pythonQchem = import ./pythonPackages.nix pkgs.config.qchem-config.prefix pkgs.config.qchem-config pkgs nixpkgs;
default = self.overlays.qchem;
};
};
}
26 changes: 13 additions & 13 deletions pythonPackages.nix
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
subset: cfg: selfPkgs: superPkgs: self: super:
subset: cfg: finalPkgs: prevPkgs: final: prev:

let
callPackage = lib.callPackageWith (
selfPkgs.pkgs // # nixpkgs
selfPkgs // # overlay
self // # python
finalPkgs.pkgs // # nixpkgs
finalPkgs // # overlay
final // # python
overlay );

inherit (selfPkgs.pkgs) lib;
inherit (finalPkgs.pkgs) lib;

overlay = {

} // lib.optionalAttrs super.isPy3k {
} // lib.optionalAttrs prev.isPy3k {
adcc = callPackage ./pkgs/apps/adcc { };

dftbplus = callPackage ./pkgs/apps/dftbplus {
inherit (selfPkgs) tblite;
inherit (finalPkgs) tblite;
};

pyqdng = callPackage ./pkgs/apps/pyQDng { };
Expand All @@ -26,7 +26,7 @@ let

moltemplate = callPackage ./pkgs/apps/moltemplate { };

openmm = superPkgs.openmm.override {
openmm = prevPkgs.openmm.override {
enablePython = true;
enableCuda = cfg.useCuda;
};
Expand All @@ -40,30 +40,30 @@ let
pylibefp = callPackage ./pkgs/lib/pylibefp { };

psi4 = callPackage ./pkgs/apps/psi4 {
libint = superPkgs.libintPsi4;
libint = prevPkgs.libintPsi4;
};

pychemps2 = callPackage ./pkgs/apps/chemps2/PyChemMPS2.nix { };

pysisyphus = callPackage ./pkgs/apps/pysisyphus {
gamess-us = selfPkgs.gamess-us.override {
gamess-us = finalPkgs.gamess-us.override {
enableMpi = false;
};
};

pyphspu = callPackage ./pkgs/lib/pyphspu { };

tblite = callPackage ./pkgs/lib/tblite/python.nix {
inherit (selfPkgs) tblite;
inherit (superPkgs) meson;
inherit (finalPkgs) tblite;
inherit (prevPkgs) meson;
};

veloxchem = callPackage ./pkgs/apps/veloxchem { };

vermouth = callPackage ./pkgs/apps/vermouth { };

xtb-python = callPackage ./pkgs/lib/xtb-python { };
} // lib.optionalAttrs super.isPy27 {
} // lib.optionalAttrs prev.isPy27 {
pyquante = callPackage ./pkgs/apps/pyquante { };
};

Expand Down

0 comments on commit d7daa86

Please sign in to comment.