stdexp: Allow extra mounts
This commit is contained in:
parent
2863ab6ae1
commit
734d494d96
@ -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 "");
|
||||
|
@ -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[@]}"
|
||||
|
@ -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 ? {}}:
|
||||
|
Loading…
Reference in New Issue
Block a user