For example,
spack install packageX %libA@2.0
would translate to nix-build -E 'with import <nixpkgs> {}; packageX.override { libA = libAv2_0; }'
For this to work, both Spack and Nix would have to package libA v2.0. If it isn't, the user would need to create their own. Assuming a different version of libA is already packaged in Nix, here's how it would look like without the "nix-build -E" part: let
pkgs = import <nixpkgs> {};
libAv2_0 = pkgs.libA.overrideAttrs (old: {
src = pkgs.fetchzip {
url = "...";
sha256 = "...";
};
});
in
pkgs.packageX.override { libA = libAv2_0; }
I assume something similar would be required for Spack too.So aside from Spack having a nicer shorthand syntax for customization, I don't get what Spack can do that Nix can't in terms of features. Or to be more specific, how a dependency resolver can eliminate human work.