diff --git a/m/module/slurm-hut-nix-store.nix b/m/module/slurm-hut-nix-store.nix new file mode 100644 index 0000000..2ec8e2f --- /dev/null +++ b/m/module/slurm-hut-nix-store.nix @@ -0,0 +1,19 @@ +{ ... }: + +{ + # Mount the hut nix store via NFS + fileSystems."/mnt/hut-nix-store" = { + device = "hut:/nix/store"; + fsType = "nfs"; + options = [ "ro" ]; + }; + + systemd.services.slurmd.serviceConfig = { + # When running a job, bind the hut store in /nix/store so the paths are + # available too. + # FIXME: This doesn't keep the programs in /run/current-system/sw/bin + # available in the store. Ideally they should be merged but the overlay FS + # doesn't work when the underlying directories change. + BindReadOnlyPaths = "/mnt/hut-nix-store:/nix/store"; + }; +} diff --git a/m/owl1/configuration.nix b/m/owl1/configuration.nix index 5afda72..d21ccfd 100644 --- a/m/owl1/configuration.nix +++ b/m/owl1/configuration.nix @@ -5,6 +5,7 @@ ../common/main.nix ../module/ceph.nix ../module/slurm-firewall.nix + ../module/slurm-hut-nix-store.nix ]; # Select the this using the ID to avoid mismatches diff --git a/m/owl2/configuration.nix b/m/owl2/configuration.nix index 9636760..5fdabbe 100644 --- a/m/owl2/configuration.nix +++ b/m/owl2/configuration.nix @@ -5,6 +5,7 @@ ../common/main.nix ../module/ceph.nix ../module/slurm-firewall.nix + ../module/slurm-hut-nix-store.nix ]; # Select the this using the ID to avoid mismatches