From 5436700dd8a5afb73beff2427bddad0e27f0f1db Mon Sep 17 00:00:00 2001
From: zowoq <59103226+zowoq@users.noreply.github.com>
Date: Thu, 7 Mar 2024 09:16:59 +1000
Subject: [PATCH] tasks.py: fix deploy username

---
 tasks.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tasks.py b/tasks.py
index 25ccc8d..8999c14 100644
--- a/tasks.py
+++ b/tasks.py
@@ -23,11 +23,13 @@ def deploy_nixos(hosts: List[DeployHost]) -> None:
         if "darwin" in h.host:
             # don't use sudo for darwin-rebuild
             command = "darwin-rebuild"
+            target = f"{h.user}@{h.host}"
         else:
             command = "sudo nixos-rebuild"
+            target = f"{h.host}"
 
         res = h.run_local(
-            ["nix", "flake", "archive", "--to", f"ssh://{h.user}@{h.host}", "--json"],
+            ["nix", "flake", "archive", "--to", f"ssh://{target}", "--json"],
             stdout=subprocess.PIPE,
         )
         data = json.loads(res.stdout)