From e5e959f90a66bee5cb60e7191aa71f4c4ed3fecc Mon Sep 17 00:00:00 2001 From: joshp123 Date: Sun, 15 Feb 2026 13:33:38 -0800 Subject: [PATCH] CI concurrency + deep-merge config fragments; fix clawdinator-2 channels - Cancel in-progress image builds on new pushes (concurrency) - Add services.clawdinator.configFragments for deep-merge tweaks - Use configFragments in clawdinator-2 to disable telegram without clobbering discord No host changes; intended to ship via next AMI build. --- .github/workflows/image-build.yml | 4 ++++ nix/hosts/clawdinator-2.nix | 8 ++++++-- nix/modules/clawdinator.nix | 13 +++++++++++-- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/image-build.yml b/.github/workflows/image-build.yml index 2e12911..576590a 100644 --- a/.github/workflows/image-build.yml +++ b/.github/workflows/image-build.yml @@ -1,5 +1,9 @@ name: Build NixOS Image +concurrency: + group: image-build-${{ github.ref }} + cancel-in-progress: true + on: workflow_dispatch: push: diff --git a/nix/hosts/clawdinator-2.nix b/nix/hosts/clawdinator-2.nix index e84cc5d..a6fb2d3 100644 --- a/nix/hosts/clawdinator-2.nix +++ b/nix/hosts/clawdinator-2.nix @@ -21,6 +21,10 @@ networking.firewall.allowedTCPPorts = [ 22 ]; - services.clawdinator.config.plugins.entries.telegram.enabled = false; - services.clawdinator.config.channels.telegram.enabled = false; + services.clawdinator.configFragments = [ + { + plugins.entries.telegram.enabled = false; + channels.telegram.enabled = false; + } + ]; } diff --git a/nix/modules/clawdinator.nix b/nix/modules/clawdinator.nix index a71a999..6e6eeed 100644 --- a/nix/modules/clawdinator.nix +++ b/nix/modules/clawdinator.nix @@ -2,10 +2,13 @@ let cfg = config.services.clawdinator; + configFragmentsMerged = lib.foldl' lib.recursiveUpdate {} cfg.configFragments; + effectiveConfig = lib.recursiveUpdate cfg.config configFragmentsMerged; + configSource = if cfg.configFile != null then cfg.configFile - else pkgs.writeText "openclaw.json" (builtins.toJSON cfg.config); + else pkgs.writeText "openclaw.json" (builtins.toJSON effectiveConfig); updateScript = pkgs.writeShellScript "clawdinator-self-update" '' set -euo pipefail @@ -310,7 +313,13 @@ in config = mkOption { type = types.attrs; default = {}; - description = "Raw Clawbot config JSON (merged into openclaw.json)."; + description = "Raw Clawbot config JSON (base)."; + }; + + configFragments = mkOption { + type = types.listOf types.attrs; + default = []; + description = "Additional OpenClaw config fragments, recursively merged into services.clawdinator.config (deep merge). Use this for small per-host tweaks without clobbering sibling keys."; }; configFile = mkOption {