Commit 28b1c2ec authored by Valentin Reis's avatar Valentin Reis

adding nix-chameleon-shell.sh

parent fd8feb50
Pipeline #5081 passed with stage
in 13 seconds
...@@ -25,8 +25,11 @@ in ...@@ -25,8 +25,11 @@ in
lammps = (argopkgs.applications.nrm.lammps.overrideAttrs (old: {src = lammps-src;} )).override {libnrm = libnrm;}; lammps = (argopkgs.applications.nrm.lammps.overrideAttrs (old: {src = lammps-src;} )).override {libnrm = libnrm;};
test = argopkgs.stdenv.mkDerivation rec { test = argopkgs.stdenv.mkDerivation rec {
name = "env"; name = "testEnv";
env = argopkgs.buildEnv { name = name; paths = buildInputs;}; installPhase = "mkdir $out";
unpackPhase = "true";
dontStrip = true;
buildPhase = "true";
buildInputs = [ buildInputs = [
argotk argotk
argopkgs.coreutils argopkgs.coreutils
......
#!/usr/bin/env sh
echo "nix-chameleon-shell.sh: building locally."
storePath=${1:-$(nix-build default.nix -A test)} # Building an environment
derivationPath=$(nix show-derivation $storePath | jq -r "keys| @csv" | sed s/\"//g) # Inelegant path query
echo "nix-chameleon-shell.sh: copying closure."
NIX_SSHOPTS="source .profile;" nix-copy-closure --include-outputs --to ${2:-cc@192.5.87.189} $derivationPath # Copying the dependency tree over to chameleon
echo "nix-chameleon-shell.sh: entering a remote shell."
ssh -t ${2:-cc@192.5.87.189} "source .profile; nix-shell $derivationPath" # Entering its environment over ssh
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment