From 1340d1d2e887c9473b71d4068631da0016594047 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Wed, 2 Dec 2020 11:58:00 +0100 Subject: [PATCH] develop: Experimental interactive support --- garlic/develop.nix | 50 ++++++++++++++++++++++++++++++++++++++++++++++ overlay.nix | 28 +++++++++++++++++++++++++- 2 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 garlic/develop.nix diff --git a/garlic/develop.nix b/garlic/develop.nix new file mode 100644 index 0000000..555666c --- /dev/null +++ b/garlic/develop.nix @@ -0,0 +1,50 @@ +{ + stdenv +, bash +, bashInteractive +, busybox +, extraInputs ? [] +}: + +stdenv.mkDerivation { + name = "develop"; + preferLocalBuild = true; + phases = [ "installPhase" ]; + buildInputs = extraInputs ++ [ busybox ]; + installPhase = '' + cat > $out < bsc.garlic.apps inherit (bsc.garlic) apps fig exp ds; + # TODO: move into garlic/default.nix garlic = { - # TODO: move into garlic/default.nix + + unsafeDevelop = callPackage ./garlic/develop.nix { + extraInputs = with self; [ + coreutils htop procps-ng vim which strace + tmux gdb kakoune universal-ctags bashInteractive + glibcLocales ncurses + # Add more nixpkgs packages here... + bsc.slurm bsc.clangOmpss2 bsc.icc bsc.mcxx bsc.perf + # Add more bscpkgs packages here... + ]; + }; + + develop = bsc.garlic.stages.exec { + nextStage = bsc.garlic.stages.isolate { + nextStage = bsc.garlic.unsafeDevelop; + nixPrefix = bsc.garlic.targetMachine.config.nixPrefix; + extraMounts = [ "/tmp:$TMPDIR" ]; + }; + nixPrefix = bsc.garlic.targetMachine.config.nixPrefix; + # This hack uploads all dependencies to MN4 + pre = '' + # Hack to upload this to MN4: @upload-to-mn@ + # Run the following command in a normal interactive shell (outside nix) + ''; + post = "\n"; + }; # Configuration for the machines machines = callPackage ./garlic/machines.nix { };