From 92d827307745405ddb2e9ea39b4e28debeda877f Mon Sep 17 00:00:00 2001 From: Sean Buckley Date: Fri, 29 Oct 2021 19:00:41 -0400 Subject: [PATCH] morph: add proxy --- lib/morph.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/morph.nix b/lib/morph.nix index 2e5bf7e..6862bd6 100644 --- a/lib/morph.nix +++ b/lib/morph.nix @@ -92,6 +92,15 @@ ssh root@$ip NIXOS_INSTALL_BOOTLOADER=1 nixos-enter --root /mnt -- /run/current-system/bin/switch-to-configuration boot ''; + proxy = sh '' + export SSH_CONFIG_FILE="${sshConfig}" + ip="$(nix eval --raw ".#nixosConfigurations.\"$1\".config.sconfig.morph.deployment.targetHost")" + shift + set -- nix run "$@" + nix copy --to ssh://$ip "${flake}" + exec ssh -t -oForwardAgent=yes "$ip" "cd ${flake}; $@" + ''; + push = sh '' exec "${morph}/bin/morph" push ${morph-config} "$@" '';