From 56a7ad00d42cc2ac78ba8e1dc00a3dadee424d24 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
Date: Sat, 13 Aug 2022 10:28:24 +0200
Subject: [PATCH] deploy: fix escaping and missing deps

---
 ci.nix | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ci.nix b/ci.nix
index 3a51b13..e2540c8 100644
--- a/ci.nix
+++ b/ci.nix
@@ -5,6 +5,7 @@
 let
   self = builtins.getFlake (toString ./.);
   nixpkgs = self.inputs.nixpkgs;
+  pkgs = nixpkgs.legacyPackages.x86_64-linux;
   effects = self.inputs.hercules-ci-effects.lib.withPkgs nixpkgs.legacyPackages.x86_64-linux;
 
   deployNixOS = args@{
@@ -19,7 +20,8 @@ let
     effectScript = ''
       umask 077 # so ssh does not complain about key permissions
       readSecretString deploy .sshKey > deploy-key
-      ssh -i deploy-key root@"$hostname" "$(nix-store -r $drv)/bin/switch-to-configuration $action"
+
+      ${pkgs.openssh}/bin/ssh -i deploy-key root@"$hostname" "\$(nix-store -r $drv)/bin/switch-to-configuration switch"
     '';
   });
 in