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 {