Consider moving BSC packages to the root attribute set
So far, we have defined all our packages inside the bsc.
attribute set, and modified the callPackage
function to first resolve the dependencies from bsc.
before attempting to take them from the root set.
This approach worked fine so far because we only worked with a reduced number of packages, where all the dependencies were contained in bsc.
. However, with the introduction of the jungle cluster, it now becomes problematic for some packages. For example, the mpi package from nixpkgs is left as-is:
hut% nix build jungle#nixpkgs.mpi --print-out-paths
/nix/store/wbc4kh7xspk0m3q8a690z0zvm6py2a5m-openmpi-4.1.5
hut% nix build jungle#bscpkgs.mpi --print-out-paths
/nix/store/wbc4kh7xspk0m3q8a690z0zvm6py2a5m-openmpi-4.1.5
However, we add our own Intel MPI in bsc.mpi
:
hut% nix build jungle#bscpkgs.bsc.mpi --print-out-paths
trace: intel-oneapi-mpi-devel-2021.9.0 -- n=1
trace: intel-oneapi-mpi-2021.9.0 -- n=1
/nix/store/wkf8mih0r1hjy54mg3riqxklsba1hm8p-intel-mpi-2021.9.0
Which gets replaced by MPICH in jungle configured for the OmniPath network:
hut% nix build jungle#bsc.mpi --print-out-paths
/nix/store/nnnaly6hgylravdrmqkhpx1ndg5p79nc-mpich-4.1.2
Now, the problem comes when we have a nixpkgs dependency that also depends on mpi, for example petsc as defined by nixpkgs:
hut% nix derivation show jungle#nixpkgs.petsc | grep -i 'mpi.*drv'
"/nix/store/ib2rckl046s6rvw2xp0xhgvhfrwck09r-openmpi-4.1.5.drv": [
By setting the mpi attribute directly, we will replace the dependency in petsc and others too.
Now, the question is if we can move the replacements to the root attribute, so they are automatically picked up by all packages and they don't break other thinks in bscpkgs. This would allow us to directly access BSC packages as:
hut% nix shell jungle#nanos6 jungle#ovni ...
Which simplifies the user experience too.