From 030e4ea318547b58e0fd5ab303e4e806c8474014 Mon Sep 17 00:00:00 2001 From: repo-worker-code Date: Mon, 16 Nov 2026 08:17:25 -0600 Subject: [PATCH] openclaw: skip the gateway on hosts without its sops secrets (#2875) home/openclaw is imported for user on every host that includes nixos/users/user, but the gateway's tokens are sops secrets declared only in nixos/hosts/amd-openclaw-secrets.nix (amd host block). On the Intel `nixos` host the unit therefore has no /run/secrets/openclaw/* and could only ever fail. Whether the Intel host should run the gateway is still unobservable (it has been absent from the tailnet since 2026-11-03), so gate the unit on the credential file it reads: a host without the secrets skips the unit quietly instead of crash-looping, and a host that later declares them gets the gateway with no second edit. amd is unchanged (the path exists). Verified: nix eval of nixosConfigurations.{amd,nixos} shows the unit's ConditionPathExists; .github/scripts/check-openclaw-unit-wants.sh and its test suite pass. --- home/openclaw/default.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/home/openclaw/default.nix b/home/openclaw/default.nix index e525ca6c94..e37c13f5a0 100644 --- a/home/openclaw/default.nix +++ b/home/openclaw/default.nix @@ -171,6 +171,18 @@ in # start-limit-hit — down for a day, silently. A transient # pre-start failure must never be able to do that again: wide # window, generous burst, slower restart spacing. + # #2875: the gateway's tokens come from /run/secrets/openclaw/*, + # which sops-nix materializes only on hosts that declare + # nixos/hosts/amd-openclaw-secrets.nix (the amd host block). This + # home module is imported for every host that includes + # nixos/users/user, so on a host without those secrets (the Intel + # `nixos` host) the unit could only ever fail. Skip it explicitly + # there instead of letting it crash-loop against a missing + # credential file: a condition-skipped unit is inactive and quiet, + # and it starts by itself the moment the host declares the + # secrets. Delete this when every host carrying the user env also + # carries its own openclaw secrets. + ConditionPathExists = "/run/secrets/openclaw/gateway-token"; StartLimitIntervalSec = "600"; StartLimitBurst = 30; };