From 4e85f86a5724b4936406c0244231ad1fa11b3ed2 Mon Sep 17 00:00:00 2001 From: Guy Chronister Date: Tue, 7 Jul 2026 18:02:34 -0500 Subject: [PATCH 1/3] nwchem: move arguments out of all-packages.nix --- .../science/chemistry/nwchem/default.nix | 28 +++++++++---------- pkgs/top-level/all-packages.nix | 6 +--- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/pkgs/applications/science/chemistry/nwchem/default.nix b/pkgs/applications/science/chemistry/nwchem/default.nix index 9b082276f676..54c5d6c6fd52 100644 --- a/pkgs/applications/science/chemistry/nwchem/default.nix +++ b/pkgs/applications/science/chemistry/nwchem/default.nix @@ -10,9 +10,9 @@ gfortran, perl, mpi, - blas, - lapack, - scalapack, + blas-ilp64, + lapack-ilp64, + scalapack-ilp64, libxc, python3, tcsh, @@ -22,8 +22,8 @@ makeWrapper, }: -assert blas.isILP64 == lapack.isILP64; -assert blas.isILP64 == scalapack.isILP64; +assert blas-ilp64.isILP64 == lapack-ilp64.isILP64; +assert blas-ilp64.isILP64 == scalapack-ilp64.isILP64; let versionGA = "5.8.2"; # Fixed by nwchem @@ -76,9 +76,9 @@ stdenv.mkDerivation rec { buildInputs = [ tcsh openssh - blas - lapack - scalapack + blas-ilp64 + lapack-ilp64 + scalapack-ilp64 libxc python3 ]; @@ -134,12 +134,12 @@ stdenv.mkDerivation rec { export PYTHONHOME="${python3}" export PYTHONVERSION=${lib.versions.majorMinor python3.version} - export BLASOPT="-L${blas}/lib -lblas" - export LAPACK_LIB="-L${lapack}/lib -llapack" - export BLAS_SIZE=${if blas.isILP64 then "8" else "4"} + export BLASOPT="-L${blas-ilp64}/lib -lblas" + export LAPACK_LIB="-L${lapack-ilp64}/lib -llapack" + export BLAS_SIZE=${if blas-ilp64.isILP64 then "8" else "4"} export USE_SCALAPACK="y" - export SCALAPACK="-L${scalapack}/lib -lscalapack" - export SCALAPACK_SIZE=${if scalapack.isILP64 then "8" else "4"} + export SCALAPACK="-L${scalapack-ilp64}/lib -lscalapack" + export SCALAPACK_SIZE=${if scalapack-ilp64.isILP64 then "8" else "4"} export LIBXC_INCLUDE="${lib.getDev libxc}/include" export LIBXC_MODDIR="${lib.getDev libxc}/include" @@ -166,7 +166,7 @@ stdenv.mkDerivation rec { ln -s ${gaSrc} src/tools/ga-${versionGA}.tar.gz cd src make nwchem_config - ${lib.optionalString (!blas.isILP64) "make 64_to_32"} + ${lib.optionalString (!blas-ilp64.isILP64) "make 64_to_32"} ''; postBuild = '' diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4cd03901f62a..c2ef35a3286e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10315,11 +10315,7 @@ with pkgs; molbar = with python3Packages; toPythonApplication molbar; - nwchem = callPackage ../applications/science/chemistry/nwchem { - blas = blas-ilp64; - lapack = lapack-ilp64; - scalapack = scalapack-ilp64; - }; + nwchem = callPackage ../applications/science/chemistry/nwchem { }; pdb2pqr = with python3Packages; toPythonApplication pdb2pqr; From 3068e2d8edc95bf84afdf0c4fa5d62c1b4ca2c01 Mon Sep 17 00:00:00 2001 From: Guy Chronister Date: Tue, 7 Jul 2026 18:34:14 -0500 Subject: [PATCH 2/3] nwchem: migrate to finalAttrs, structuredAttrs, and strictDeps --- .../science/chemistry/nwchem/default.nix | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/science/chemistry/nwchem/default.nix b/pkgs/applications/science/chemistry/nwchem/default.nix index 54c5d6c6fd52..a11d651b3d7a 100644 --- a/pkgs/applications/science/chemistry/nwchem/default.nix +++ b/pkgs/applications/science/chemistry/nwchem/default.nix @@ -20,6 +20,7 @@ autoconf, libtool, makeWrapper, + mpich, }: assert blas-ilp64.isILP64 == lapack-ilp64.isILP64; @@ -48,17 +49,20 @@ let }; in -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "nwchem"; version = "7.2.3"; src = fetchFromGitHub { owner = "nwchemgit"; repo = "nwchem"; - rev = "v${version}-release"; + tag = "v${finalAttrs.version}-release"; hash = "sha256-2qc4kLb/WmUJuJGonIyS7pgCfyt8yXdcpDAKU0RMY58="; }; + strictDeps = true; + __structuredAttrs = true; + outputs = [ "out" "dev" @@ -72,10 +76,12 @@ stdenv.mkDerivation rec { makeWrapper gfortran which + mpich + python3 + openssh ]; buildInputs = [ tcsh - openssh blas-ilp64 lapack-ilp64 scalapack-ilp64 @@ -236,4 +242,4 @@ stdenv.mkDerivation rec { homepage = "https://nwchemgit.github.io"; license = lib.licenses.ecl20; }; -} +}) From 675204a0816f04aada2de59ff1d6906e7876b054 Mon Sep 17 00:00:00 2001 From: Guy Chronister Date: Tue, 7 Jul 2026 18:36:06 -0500 Subject: [PATCH 3/3] nwchem: migrate to by-name --- .../nwchem/default.nix => by-name/nw/nwchem/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 2 deletions(-) rename pkgs/{applications/science/chemistry/nwchem/default.nix => by-name/nw/nwchem/package.nix} (100%) diff --git a/pkgs/applications/science/chemistry/nwchem/default.nix b/pkgs/by-name/nw/nwchem/package.nix similarity index 100% rename from pkgs/applications/science/chemistry/nwchem/default.nix rename to pkgs/by-name/nw/nwchem/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c2ef35a3286e..4ee9ae8f1fef 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10315,8 +10315,6 @@ with pkgs; molbar = with python3Packages; toPythonApplication molbar; - nwchem = callPackage ../applications/science/chemistry/nwchem { }; - pdb2pqr = with python3Packages; toPythonApplication pdb2pqr; quantum-espresso = callPackage ../applications/science/chemistry/quantum-espresso {