Commit 1894c559fa30

Vincent Demeester <vincent@sbr.pm>
2026-05-05 08:02:08
fix(passage): prevent sync service from hanging
Used wrapper script for GIT_SSH_COMMAND to fix systemd Environment quoting. Added ConnectTimeout, BatchMode=yes, and ServerAliveInterval to fail fast when remote is unreachable instead of hanging for hours. Added 60s service timeout as safety net.
1 parent a926726
Changed files (1)
home
common
home/common/desktop/passage.nix
@@ -17,10 +17,14 @@
     };
     Service = {
       Type = "oneshot";
-      ExecStart = "${pkgs.passage}/bin/passage git pull --rebase";
+      ExecStart = toString (
+        pkgs.writeShellScript "passage-update" ''
+          export GIT_SSH_COMMAND="ssh -i ${config.home.homeDirectory}/.ssh/id_passage -o IdentitiesOnly=yes -o IdentityAgent=none -o ConnectTimeout=10 -o ServerAliveInterval=5 -o ServerAliveCountMax=3 -o BatchMode=yes"
+          ${pkgs.passage}/bin/passage git pull --rebase
+        ''
+      );
       WorkingDirectory = config.home.sessionVariables.PASSAGE_DIR;
-      # Use dedicated non-SK key to avoid Yubikey touch prompts during automated sync
-      Environment = "GIT_SSH_COMMAND=ssh -i ${config.home.homeDirectory}/.ssh/id_passage -o IdentitiesOnly=yes -o IdentityAgent=none";
+      TimeoutStartSec = "60s";
     };
   };