Skip to content
Closed
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
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dotagents
Submodule dotagents updated 1 files
+0 −2 SKILLS.txt
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

110 changes: 83 additions & 27 deletions home-manager/modules/clawdbot/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,54 @@ lib.mkIf (!env.isCI) {
''
);

# Inject gateway auth token into clawdbot.json for local mode on kyber (tokenFile deprecated)
home.activation.clawdbotGatewayToken = lib.mkIf (lib ? hm && lib.hm ? dag && host.isKyber) (
lib.hm.dag.entryAfter [ "clawdbotSecrets" "clawdbotConfigFiles" ] ''
TOKEN_FILE="${clawdbotDir}/gateway-token"
CONFIG_FILE="${homeDir}/.clawdbot/clawdbot.json"
if [ -f "$TOKEN_FILE" ] && [ -f "$CONFIG_FILE" ]; then
TOKEN=$(${pkgs.coreutils}/bin/cat "$TOKEN_FILE" | ${pkgs.coreutils}/bin/tr -d '\n')
# Inject token into gateway.auth.token
${pkgs.jq}/bin/jq --arg token "$TOKEN" \
'.gateway.auth.token = $token' \
"$CONFIG_FILE" > "$CONFIG_FILE.tmp" && \
${pkgs.coreutils}/bin/mv "$CONFIG_FILE.tmp" "$CONFIG_FILE"
echo "Injected gateway auth token into clawdbot config"
fi
''
);

# Inject telegram bot token into clawdbot.json for kyber (botTokenFile deprecated)
home.activation.clawdbotTelegramToken = lib.mkIf (lib ? hm && lib.hm ? dag && host.isKyber) (
lib.hm.dag.entryAfter [ "clawdbotSecrets" "clawdbotConfigFiles" ] ''
TOKEN_FILE="${clawdbotDir}/telegram-token"
CONFIG_FILE="${homeDir}/.clawdbot/clawdbot.json"
if [ -f "$TOKEN_FILE" ] && [ -f "$CONFIG_FILE" ]; then
TOKEN=$(${pkgs.coreutils}/bin/cat "$TOKEN_FILE" | ${pkgs.coreutils}/bin/tr -d '\n')
# Inject botToken into channels.telegram
${pkgs.jq}/bin/jq --arg token "$TOKEN" \
'.channels.telegram.botToken = $token' \
"$CONFIG_FILE" > "$CONFIG_FILE.tmp" && \
${pkgs.coreutils}/bin/mv "$CONFIG_FILE.tmp" "$CONFIG_FILE"
echo "Injected telegram bot token into clawdbot config"
fi
''
);

# Clean up deprecated config keys (byProvider, etc.) on kyber
home.activation.clawdbotCleanDeprecated = lib.mkIf (lib ? hm && lib.hm ? dag && host.isKyber) (
lib.hm.dag.entryAfter [ "clawdbotTelegramToken" ] ''
CONFIG_FILE="${homeDir}/.clawdbot/clawdbot.json"
if [ -f "$CONFIG_FILE" ]; then
# Remove deprecated keys that cause config validation errors
${pkgs.jq}/bin/jq 'del(.messages.queue.byProvider)' \
"$CONFIG_FILE" > "$CONFIG_FILE.tmp" && \
${pkgs.coreutils}/bin/mv "$CONFIG_FILE.tmp" "$CONFIG_FILE"
echo "Cleaned deprecated config keys from clawdbot config"
fi
''
);

# Inject gateway token into clawdbot.json for remote mode (tokenFile not supported upstream)
home.activation.clawdbotRemoteToken = lib.mkIf (lib ? hm && lib.hm ? dag && !host.isKyber) (
lib.hm.dag.entryAfter [ "clawdbotSecrets" "clawdbotConfigFiles" ] ''
Expand Down Expand Up @@ -168,7 +216,7 @@ lib.mkIf (!env.isCI) {

# Default settings
defaults = {
model = "anthropic/claude-opus-4-5";
model = "cliproxy/claude-opus-4-5-20251101";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The model name cliproxy/claude-opus-4-5-20251101 appears to include a version identifier that resembles a date. If this identifier signifies an expiration date or a specific version lifetime, it would be beneficial for future maintenance to add a comment explaining its meaning. This will help prevent unexpected failures and guide developers on necessary updates in the future.

thinkingDefault = "high";
};

Expand All @@ -187,17 +235,24 @@ lib.mkIf (!env.isCI) {
configOverrides =
# Kyber only: Local gateway mode with browser + bridge for nodes
lib.optionalAttrs host.isKyber {
# Explicitly disable memory plugin slot (upstream defaults to "memory-core" if undefined)
# Set to "none" to disable the slot (empty string gets normalized to default)
plugins.slots.memory = "none";
# Override messages.queue to use byChannel instead of deprecated byProvider
messages.queue = {
mode = "interrupt";
byChannel = {
discord = "queue";
telegram = "interrupt";
webchat = "queue";
};
};
gateway = {
mode = "local";
bind = "lan";
auth = {
tokenFile = "${clawdbotDir}/gateway-token";
};
};
bridge = {
enabled = true;
bind = "lan"; # Allow nodes to connect from LAN/ingress
# auth.token injected by activation script (tokenFile deprecated in new clawdbot)
};
# bridge removed - deprecated in new clawdbot version
browser = {
enabled = true;
headless = true;
Expand All @@ -211,7 +266,7 @@ lib.mkIf (!env.isCI) {
providers = {
cliproxy = {
baseUrl = "http://localhost:8317/v1";
apiKeyFile = "${clawdbotDir}/cliproxy-key";
# apiKey injected by activation script (apiKeyFile deprecated)
api = "openai-completions";
models =
let
Expand Down Expand Up @@ -324,6 +379,23 @@ lib.mkIf (!env.isCI) {
};
};
};
# Telegram channel config (moved from root telegram key to channels.telegram)
channels.telegram = {
# botToken injected by activation script
allowFrom = [
983653361
2104262990
];
groups = {
"*" = {
requireMention = false;
};
"-1003612372477" = {
enabled = true;
requireMention = false;
};
};
};
}
# All other hosts (macOS + non-kyber Linux): Remote mode - connect to kyber gateway
// lib.optionalAttrs (!host.isKyber) {
Expand All @@ -350,24 +422,8 @@ lib.mkIf (!env.isCI) {
apiKeyFile = "${clawdbotDir}/anthropic-key";
};

# Telegram provider - kyber gateway only (reads from ~/.config/clawdbot/telegram-token)
providers.telegram = {
enable = host.isKyber;
botTokenFile = "${clawdbotDir}/telegram-token";
allowFrom = [
983653361
2104262990
];
groups = {
"*" = {
requireMention = false;
};
"-1003612372477" = {
enabled = true;
requireMention = false;
};
};
};
# Telegram config moved to configOverrides.channels.telegram (new clawdbot schema)
# providers.telegram deprecated - see configOverrides above

# # iMessage provider - macOS only (reads messages from anyone)
# providers.imessage = {
Expand Down
113 changes: 2 additions & 111 deletions overlays/default.nix
Original file line number Diff line number Diff line change
@@ -1,118 +1,9 @@
{ inputs }:
let
# Override clawdbot source to v2026.1.21
clawdbotSourceOverride = {
owner = "clawdbot";
repo = "clawdbot";
rev = "80c1edc3ff43b3bd3b7b545eed79f303d992f7dc";
hash = "sha256-IsTNC79KXKL7ByBh7zUmH6qXx0YFdiQ4a4TI40C53U8=";
pnpmDepsHash = "sha256-tGzKcCiZNlWlKMNNFmxcFpIvO92G9myhM+OYaGea4hw=";
};
# Override clawdbot-app to v2026.1.21 (fixes broken app package)
clawdbotAppOverride = {
version = "2026.1.21";
url = "https://github.com/clawdbot/clawdbot/releases/download/v2026.1.21/Clawdbot-2026.1.21.zip";
hash = "sha256-EhGRakuN0dhEkXvrOd21t79odf4T2jY7oKFRubLqGbI=";
};
in
[
inputs.nur.overlays.default
inputs.neovim-nightly-overlay.overlays.default
# Custom clawdbot overlay with version override (replaces inputs.nix-clawdbot.overlays.default)
(
final: prev:
let
clawdbotVersion = "2026.1.21";
basePkgs = import "${inputs.nix-clawdbot}/nix/packages" {
pkgs = prev;
sourceInfo = clawdbotSourceOverride;
};
# Override version in clawdbot-gateway (it's hardcoded in the derivation)
# src is already correct from sourceInfo, just need to update version string
clawdbot-gateway = basePkgs.clawdbot-gateway.overrideAttrs (old: {
version = clawdbotVersion;
__intentionallyOverridingVersion = true;
});
# Build clawdbot-app with fixed version (upstream has broken app package)
clawdbot-app =
if prev.stdenv.isDarwin then
prev.stdenvNoCC.mkDerivation {
pname = "clawdbot-app";
version = clawdbotAppOverride.version;
src = prev.fetchzip {
url = clawdbotAppOverride.url;
hash = clawdbotAppOverride.hash;
stripRoot = false;
};
dontUnpack = true;
installPhase = ''
mkdir -p "$out/Applications"
app_path="$(find "$src" -maxdepth 2 -name '*.app' -print -quit)"
if [ -z "$app_path" ]; then
echo "Clawdbot.app not found in $src" >&2
exit 1
fi
cp -pR "$app_path" "$out/Applications/Clawdbot.app"
'';
meta = with prev.lib; {
description = "Clawdbot macOS app bundle";
homepage = "https://github.com/clawdbot/clawdbot";
license = licenses.mit;
platforms = platforms.darwin;
};
}
else
null;
# Rebuild batteries bundle with the overridden gateway and app
clawdbot = prev.callPackage "${inputs.nix-clawdbot}/nix/packages/clawdbot-batteries.nix" {
clawdbot-gateway = clawdbot-gateway;
inherit clawdbot-app;
extendedTools = (import "${inputs.nix-clawdbot}/nix/tools/extended.nix" { pkgs = prev; }).tools;
};
toolNames = (import "${inputs.nix-clawdbot}/nix/tools/extended.nix" { pkgs = prev; }).toolNames;
withTools =
{
toolNamesOverride ? null,
excludeToolNames ? [ ],
}:
let
toolSets = import "${inputs.nix-clawdbot}/nix/tools/extended.nix" {
pkgs = prev;
inherit toolNamesOverride excludeToolNames;
};
innerPkgs = import "${inputs.nix-clawdbot}/nix/packages" {
pkgs = prev;
sourceInfo = clawdbotSourceOverride;
inherit toolNamesOverride excludeToolNames;
};
innerGateway = innerPkgs.clawdbot-gateway.overrideAttrs (old: {
version = clawdbotVersion;
__intentionallyOverridingVersion = true;
});
in
innerPkgs
// {
clawdbot-gateway = innerGateway;
clawdbot = prev.callPackage "${inputs.nix-clawdbot}/nix/packages/clawdbot-batteries.nix" {
clawdbot-gateway = innerGateway;
inherit clawdbot-app;
extendedTools = toolSets.tools;
};
};
in
{
inherit clawdbot clawdbot-gateway;
clawdbotPackages = {
inherit
clawdbot
clawdbot-gateway
toolNames
withTools
;
};
}
// (if prev.stdenv.isDarwin then { inherit clawdbot-app; } else { })
)
# Use default nix-clawdbot overlay (updated to latest version with PR #1554 fix)
inputs.nix-clawdbot.overlays.default
(final: prev: {
# Ensure neovim-unwrapped exposes a lua attribute for wrapper consumers (e.g., home-manager)
neovim-unwrapped =
Expand Down
Loading