shell: don't populate when source doesn't evaluate

This commit is contained in:
tv 2017-07-08 14:58:09 +02:00
parent 1fb964e841
commit fc3f5d3d56

View File

@ -85,18 +85,19 @@ let
}; };
populate = pkgs.writeDash "init.env.populate" '' populate = pkgs.writeDash "init.env.populate" ''
set -efu set -efu
${pkgs.nix}/bin/nix-instantiate \ _source=$(${pkgs.nix}/bin/nix-instantiate \
--eval \ --eval \
--json \ --json \
--readonly-mode \ --readonly-mode \
--show-trace \ --show-trace \
--strict \ --strict \
-I nixos-config="$config" \ -I nixos-config="$config" \
-E 'with import <stockholm>; config.krebs.build.source' \ -E 'with import <stockholm>; config.krebs.build.source')
| echo $_source |
${pkgs.populate}/bin/populate \ ${pkgs.populate}/bin/populate \
"$target_user@$target_host:$target_port$target_path" \ "$target_user@$target_host:$target_port$target_path" \
>&2 >&2
unset _source
''; '';
proxy = pkgs.writeDash "init.env.proxy" '' proxy = pkgs.writeDash "init.env.proxy" ''
set -efu set -efu