From 5f9b59a2a0b6da9fa7b26e17c61717ce5a4ccae6 Mon Sep 17 00:00:00 2001 From: repo-worker-code-k Date: Tue, 10 Nov 2026 17:12:35 -0600 Subject: [PATCH] fix(watchdog): set expectedVersion at the NixOS layer where the option lives (#8255) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The #8255 landing set services.opencode-watchdog.expectedVersion in home/common/default.nix, but the watchdog module is a NixOS import (nixos/hosts) — no such option exists in home-manager, so evaluating the amd config has failed on main since: The option home-manager.users.user.services.opencode-watchdog does not exist. That blocks every nixos-rebuild switch. Move the setting next to enable=true in nixos/hosts/default.nix, computing the expected build from the same opencode derivation name the original code used, and drop the orphaned home-manager line plus its now-unused let. --- home/common/default.nix | 10 ---------- nixos/hosts/default.nix | 19 ++++++++++++++++++- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/home/common/default.nix b/home/common/default.nix index e17043d7d1..7f0c828e83 100644 --- a/home/common/default.nix +++ b/home/common/default.nix @@ -130,15 +130,6 @@ let # wrapper below execs it, and the wrapped package joins over it. opencodeCascade = inputs.openchamber.inputs.opencode.packages.${system}.opencode; - # The build the watchdog's build-identity check (code#8255) expects - # on the port — read from the name of the very package derivation - # the unit runs (opencodeCascade), so expectation and ExecStart - # resolve from one derivation and cannot drift apart. - watchdogExpectedVersion = - let - m = builtins.match "opencode-(.*)" inputs.openchamber.inputs.opencode.packages.${system}.opencode.name; - in - if m == null then "" else builtins.head m; # Drew's opencode wrapper -- formerly a standalone home.packages # entry (writeShellScriptBin "opencode"), logic unchanged: # Cloudflare env top-up and the stamp-gated sync-models @@ -1114,7 +1105,6 @@ in }; - services.opencode-watchdog.expectedVersion = watchdogExpectedVersion; services.opencode = { # enable comes from the cascade (mkDefault at each layer). diff --git a/nixos/hosts/default.nix b/nixos/hosts/default.nix index 85c49e5ccd..59ac242f6b 100644 --- a/nixos/hosts/default.nix +++ b/nixos/hosts/default.nix @@ -99,7 +99,24 @@ in # so after a 120s dark grace window the watchdog alerts and # restarts the unit (Restart=always would race lifecycle # handovers — see the module). - services.opencode-watchdog.enable = true; + services.opencode-watchdog = { + enable = true; + # The build the watchdog's build-identity check (code#8255) + # expects on the port, read from the name of the very + # opencode package derivation the unit runs (openchamber's + # nested opencode input — the same derivation home/common's + # cascade wraps), so expectation and ExecStart resolve from + # one derivation and cannot drift apart. This option lives + # at the NixOS level (this module is a NixOS import); the + # home-manager copy of this setting that #8255 landed in + # home/common/default.nix named an option that does not + # exist there and broke evaluation of the whole config. + expectedVersion = + let + m = builtins.match "opencode-(.*)" inputs.openchamber.inputs.opencode.packages.x86_64-linux.opencode.name; + in + if m == null then "" else builtins.head m; + }; } { # Laptop backups (code#1516, dezren39/nix#976): the dashboard