Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion home/openclaw/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ source in the fleet next to Muse (Archer) and Aster (Dot). It is installed
- **Service:** systemd user unit `openclaw-gateway` (linger is on, so it
starts at boot). Logs: `journalctl --user -u openclaw-gateway -f`.
- **Control UI / WebChat:** `http://amd-6.raptor-pumpkinseed.ts.net:18789/`
(tailnet bind, token auth). Token: `~/.secrets/openclaw/gateway-token`
(tailnet bind, token auth). Token: `/run/secrets/openclaw/gateway-token`
(0600, machine-local, never in git or the Nix store).
- **Config:** `programs.openclaw` in `default.nix` here; rendered to
`~/.openclaw/openclaw.json` at activation. Nix mode is on: change the
Expand Down
11 changes: 6 additions & 5 deletions home/openclaw/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
# into ~/.openclaw/workspace) for the knowledge pack it runs with.
#
# Secrets: referenced by path/name only, never values. The gateway token
# lives in ~/.secrets/openclaw/gateway-token (0600, created on the machine,
# not in git, not in the Nix store) and is read at service start.
# lives in /run/secrets/openclaw/gateway-token (decrypted by sops-nix at
# activation from secrets/sops/common/bws.yaml; never in git or the Nix
# store) and is read at service start.
let
homeDir = "/home/user";
# Local provider-proxy ports. The canonical definitions live in
Expand Down Expand Up @@ -90,9 +91,9 @@ in
# from that file at service start (nix-openclaw runtime contract), so
# the token itself never enters the store.
environment = {
OPENCLAW_GATEWAY_TOKEN = "${homeDir}/.secrets/openclaw/gateway-token";
OPENCLAW_SLACK_BOT_TOKEN = "/home/user/.secrets/openclaw/slack-bot-token";
OPENCLAW_SLACK_APP_TOKEN = "/home/user/.secrets/openclaw/slack-app-token";
OPENCLAW_GATEWAY_TOKEN = "/run/secrets/openclaw/gateway-token";
OPENCLAW_SLACK_BOT_TOKEN = "/run/secrets/openclaw/slack-bot-token";
OPENCLAW_SLACK_APP_TOKEN = "/run/secrets/openclaw/slack-app-token";
Comment on lines +94 to +96

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Align secret provisioning with the shared OpenClaw module

When applying the declared nixos (Intel) host, these new token paths are never provisioned: nixos/hosts/default.nix includes user on both hosts, and nixos/users/user/default.nix → home/user/default.nix imports OpenClaw unconditionally, but only amd imports the new secrets module. An Intel deployment using the previous machine-local token files therefore loses its gateway and Slack credentials after this change. Either provision the secrets wherever OpenClaw is enabled or scope the new paths and OpenClaw configuration to amd.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disposition: valid multi-host concern, not fixable inside this PR — tracked as a follow-up (filed from queue task 1640).

Why provisioning the secrets on the nixos (Intel) host is not an option today:

The one real regression path the finding identifies — an Intel deployment that manually created ~/.secrets/openclaw/* — is exactly what the follow-up issue covers: audit whether the Intel host runs the gateway, and either add its key as a bws.yaml recipient + import the secrets module there, or scope the OpenClaw home module to amd.

This PR therefore keeps the amd-only provisioning that #1242 designed; merging it does not change the Intel host's ability to decrypt anything, and its gateway (if any) is the follow-up's subject, not silently dropped here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up from task 7989 at current main (7d3dbd0): the source still includes home/openclaw for both nixos and amd, while only amd imports the OpenClaw sops secrets. PR #2871 is merged and issue #2875 remains the active follow-up. I could not verify Intel runtime service state or legacy ~/.secrets/openclaw/*: ssh nixos does not resolve from this laptop, and Tailscale shows only local amd-6. The issue is blocked pending reachable-host/read-only runtime evidence; do not add Intel sops provisioning without a per-host age recipient.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outcome (task 17504, 2026-11-16): this thread is now closed by PR #10777, merged as be7c0be. The gateway unit (home/openclaw/default.nix) carries ConditionPathExists = /run/secrets/openclaw/gateway-token, so the Intel nixos host — which imports the home module but not the amd-only sops secrets — skips the unit quietly instead of crash-looping; amd is unchanged. Verified at current main. Residual question (should the Intel host run the gateway at all, i.e. provision its age recipient) stays open on issue #2875 pending Drew — the host is still absent from the tailnet and nixos does not resolve from the fleet.

};

# Extra binaries on the gateway's PATH (not the login shell's):
Expand Down
2 changes: 1 addition & 1 deletion home/openclaw/workspace/CHANNELS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Live today

- **Control UI / WebChat** — the gateway UI on the tailnet: `http://amd-6.raptor-pumpkinseed.ts.net:18789/` (token auth; token at `~/.secrets/openclaw/gateway-token`). Also the `openclaw` CLI on this laptop (`openclaw agent --message "…"`, `openclaw status`, `openclaw doctor`).
- **Control UI / WebChat** — the gateway UI on the tailnet: `http://amd-6.raptor-pumpkinseed.ts.net:18789/` (token auth; token at `/run/secrets/openclaw/gateway-token`). Also the `openclaw` CLI on this laptop (`openclaw agent --message "…"`, `openclaw status`, `openclaw doctor`).
- **ACP coding sessions** from any connected surface: `/acp spawn opencode` (the only ACP harness wired so far; Claude/Codex run via their native runtime plugins).

## Plugins loaded, channels pending Drew's one-time setup
Expand Down
2 changes: 1 addition & 1 deletion home/openclaw/workspace/TOOLS.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ For real coding, spawn an ACP session instead of improvising: `/acp spawn openco

- The system flake is `~/code/flake.nix`; host `amd`. Apply user-level changes with the Home Manager activation package from that flake; full `sudo nixos-rebuild switch --flake ~/code#amd` is Drew's to run (sudo needs his password).
- Never scatter code in $HOME — code goes in developing-today/code (private/sensitive material: dezren39/hatch-personal).
- Secrets are referenced **by name only** (Bitwarden Secrets Manager / sops under `/run/secrets/agent-auth/`). Never write a secret value into a file, commit, chat, or log. This gateway's own token lives at `~/.secrets/openclaw/gateway-token` (0600, not in git, not in the Nix store).
- Secrets are referenced **by name only** (Bitwarden Secrets Manager / sops under `/run/secrets/agent-auth/`). Never write a secret value into a file, commit, chat, or log. This gateway's own token lives at `/run/secrets/openclaw/gateway-token` (0600, not in git, not in the Nix store).
22 changes: 22 additions & 0 deletions nixos/hosts/amd-openclaw-secrets.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{ lib, ... }:
let
userSecret = key: {
inherit key;
sopsFile = lib.from-root "secrets/sops/common/bws.yaml";
owner = "user";
mode = "0400";
};
in
{
# OpenClaw gateway + channel tokens. Bitwarden Secrets Manager is the
# source of truth; lib/bws-to-sops.sh mirrors every bws secret into
# secrets/sops/common/bws.yaml (age-encrypted to this host). sops-nix
# decrypts these at system activation to /run/secrets/openclaw/*,
# where the openclaw-gateway user service reads them through the
# wrapper's file-based environment (see home/openclaw).
sops.secrets = {
"openclaw/gateway-token" = userSecret "openclaw.gateway-token";
"openclaw/slack-bot-token" = userSecret "openclaw.slack-bot-token";
"openclaw/slack-app-token" = userSecret "openclaw.slack-app-token";
};
}
1 change: 1 addition & 0 deletions nixos/hosts/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ in
# see the file for the one-time on-machine credential setup.
./amd-krdp.nix
./amd-ipv4-preference.nix
./amd-openclaw-secrets.nix
];
};
# amd-server = host {
Expand Down