diff --git a/garlic/stages/isolate/default.nix b/garlic/stages/isolate/default.nix index b8c0722..9ca73e0 100644 --- a/garlic/stages/isolate/default.nix +++ b/garlic/stages/isolate/default.nix @@ -9,10 +9,16 @@ nextStage , nixPrefix , clusterName ? "mn4" +, extraMounts ? [] }: with garlicTools; +with builtins; +let + slashM = map (line: "-m ${line}") extraMounts; + extraMountOptions = concatStringsSep "\n" slashM; +in stdenv.mkDerivation { name = "isolate"; preferLocalBuild = true; @@ -20,7 +26,7 @@ stdenv.mkDerivation { src = ./.; dontPatchShebangs = true; programPath = "/bin/stage1"; - inherit nixPrefix clusterName nixtools busybox; + inherit nixPrefix clusterName nixtools busybox extraMountOptions; inherit nextStage; program = stageProgram nextStage; desc = "# $out\n" + (if builtins.hasAttr "desc" nextStage then nextStage.desc else ""); diff --git a/garlic/stages/isolate/stage1 b/garlic/stages/isolate/stage1 index 4b97bd2..6a624cd 100644 --- a/garlic/stages/isolate/stage1 +++ b/garlic/stages/isolate/stage1 @@ -19,6 +19,7 @@ env=( $(env | grep ^PMI || true) $(env | grep ^GARLIC || true) $(env | grep ^USER || true) + $(env | grep ^TMPDIR || true) HOME="/homeless-shelter" ) @@ -39,6 +40,7 @@ mounts=( -m /gpfs/projects/bsc15 -m /gpfs/scratch/bsc15 -m /bin:@nixPrefix@@busybox@/bin + @extraMountOptions@ ) join_flags="${mounts[@]}" diff --git a/garlic/stdexp.nix b/garlic/stdexp.nix index 880a504..cb208f7 100644 --- a/garlic/stdexp.nix +++ b/garlic/stdexp.nix @@ -75,11 +75,17 @@ rec { } ); - isolate = {nextStage, conf, ...}: stages.isolate { - clusterName = machineConf.name; - inherit (conf) nixPrefix; - inherit nextStage; - }; + isolate = {nextStage, conf, ...}: stages.isolate ( + ( + if (conf ? extraMounts) then { inherit (conf) extraMounts; } + else {} + ) // + { + clusterName = machineConf.name; + inherit (conf) nixPrefix; + inherit nextStage; + } + ); }; stdPipelineOverride = {overrides ? {}}: