summaryrefslogtreecommitdiffstats
path: root/shell.nix
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2017-07-12 19:11:29 +0200
committerlassulus <lassulus@lassul.us>2017-07-12 19:11:29 +0200
commitb19ebc2abd8f383d477d35040e833cd9c05319ab (patch)
tree778a882e0faebc82360c06165b4b00726468b8aa /shell.nix
parent5efedd139a20d71268af2afd069dbd595414650f (diff)
parentcd47613a4d8daf185f4ac0f8ef43af11985a2f65 (diff)
Merge branch 'staging/source'
Diffstat (limited to 'shell.nix')
-rw-r--r--shell.nix13
1 files changed, 8 insertions, 5 deletions
diff --git a/shell.nix b/shell.nix
index 3e7ba81c..57957f82 100644
--- a/shell.nix
+++ b/shell.nix
@@ -43,9 +43,11 @@ let
'';
init.env = pkgs.writeText "init.env" /* sh */ ''
- config=''${config-$LOGNAME/1systems/$system.nix}
+ config=''${config-$LOGNAME/1systems/$system/config.nix}
+ source=''${source-$LOGNAME/1systems/$system/source.nix}
export config
+ export source
export system
export target
@@ -85,18 +87,19 @@ let
};
populate = pkgs.writeDash "init.env.populate" ''
set -efu
- ${pkgs.nix}/bin/nix-instantiate \
+ _source=$(${pkgs.nix}/bin/nix-instantiate \
--eval \
--json \
--readonly-mode \
--show-trace \
--strict \
-I nixos-config="$config" \
- -E 'with import <stockholm>; config.krebs.build.source' \
- |
+ "$source")
+ echo $_source |
${pkgs.populate}/bin/populate \
"$target_user@$target_host:$target_port$target_path" \
>&2
+ unset _source
'';
proxy = pkgs.writeDash "init.env.proxy" ''
set -efu
@@ -109,7 +112,7 @@ let
NIX_PATH=$(q "$target_path") \
STOCKHOLM_VERSION=$STOCKHOLM_VERSION \
nix-shell \
- --command $(q \
+ --run $(q \
config=$config \
system=$system \
target=$target \