develop: support for srun

This commit is contained in:
Rodrigo Arias 2020-12-02 13:38:43 +01:00
parent f87d830218
commit df1f22c122
2 changed files with 13 additions and 4 deletions

View File

@ -33,10 +33,13 @@ stdenv.mkDerivation {
export TEMP=/tmp export TEMP=/tmp
export LANG=en_US.UTF-8 export LANG=en_US.UTF-8
export TERM=linux
source ${stdenv}/setup source ${stdenv}/setup
# Access to bin and nix tools for srun, as it keeps the PATH
export "PATH=\$PATH:/bin"
export "PATH=$PATH:/gpfs/projects/bsc15/nix/bin"
if [[ -z "\$@" ]]; then if [[ -z "\$@" ]]; then
exec ${bashInteractive}/bin/bash exec ${bashInteractive}/bin/bash
else else

View File

@ -198,7 +198,7 @@ let
]; ];
}; };
develop = bsc.garlic.stages.exec { develop = bsc.garlic.stages.exec rec {
nextStage = bsc.garlic.stages.isolate { nextStage = bsc.garlic.stages.isolate {
nextStage = bsc.garlic.unsafeDevelop; nextStage = bsc.garlic.unsafeDevelop;
nixPrefix = bsc.garlic.targetMachine.config.nixPrefix; nixPrefix = bsc.garlic.targetMachine.config.nixPrefix;
@ -206,9 +206,15 @@ let
}; };
nixPrefix = bsc.garlic.targetMachine.config.nixPrefix; nixPrefix = bsc.garlic.targetMachine.config.nixPrefix;
# This hack uploads all dependencies to MN4 # This hack uploads all dependencies to MN4
pre = '' pre = let
nixPrefix = bsc.garlic.targetMachine.config.nixPrefix;
stageProgram = bsc.garlicTools.stageProgram;
in
''
# Hack to upload this to MN4: @upload-to-mn@ # Hack to upload this to MN4: @upload-to-mn@
# Run the following command in a normal interactive shell (outside nix)
# Create a link to the develop script
ln -fs ${nixPrefix}${stageProgram nextStage} .nix-develop
''; '';
post = "\n"; post = "\n";
}; };