Skip to content
Draft
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
5 changes: 2 additions & 3 deletions docs/rfc/2026-01-02-declarative-clawdis-nix.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ This RFC is complete when:

## 12) Implementation status (current)

- Gateway pinned to `v2.0.0-beta4`.
- App DMG pinned to `v2.0.0-beta4`.
- Gateway pinned to `v2.0.0-beta5`.
- App DMG pinned to `v2.0.0-beta5`.
- Batteries‑included package output is wired in the flake.
- README is the single onboarding source.

19 changes: 17 additions & 2 deletions nix/modules/home-manager/clawdis.nix
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ let
plugins = resolvedPluginsByInstance.${instName} or [];
envFor = p: (p.config.env or {});
missingFor = p:
lib.filter (req: !(envFor p ? req)) p.needs.requiredEnv;
lib.filter (req: !(builtins.hasAttr req (envFor p))) p.needs.requiredEnv;
configMissingStateDir = p:
(p.config.settings or {}) != {} && (p.needs.stateDirs or []) == [];
mkAssertion = p:
Expand Down Expand Up @@ -569,11 +569,16 @@ let
export ANTHROPIC_API_KEY
fi

if [ "$#" -eq 0 ]; then
exec "${gatewayPackage}/bin/clawdis" gateway-daemon
fi
exec "${gatewayPackage}/bin/clawdis" "$@"
'';
in {
configJson = configJson;
configPath = inst.configPath;
homeFile = {
name = inst.configPath;
name = toRelative inst.configPath;
value = { text = configJson; };
};

Expand Down Expand Up @@ -626,6 +631,11 @@ let
};

instanceConfigs = lib.mapAttrsToList mkInstanceConfig enabledInstances;
configWrites = lib.concatStringsSep "\n" (map (item: ''
cat <<'CLAWDIS_CONFIG' > ${lib.escapeShellArg item.configPath}
${item.configJson}
CLAWDIS_CONFIG
'') instanceConfigs);
appInstalls = lib.filter (item: item != null) (map (item: item.appInstall) instanceConfigs);

appDefaults = lib.foldl' (acc: item: lib.recursiveUpdate acc item.appDefaults) {} instanceConfigs;
Expand Down Expand Up @@ -800,6 +810,11 @@ in {
${lib.optionalString (pluginStateDirsAll != []) "/bin/mkdir -p ${lib.concatStringsSep " " pluginStateDirsAll}"}
'';

home.activation.clawdisConfig = lib.hm.dag.entryAfter [ "clawdisDirs" ] ''
set -euo pipefail
${configWrites}
'';

home.activation.clawdisPluginGuard = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
set -euo pipefail
${pluginGuards}
Expand Down
8 changes: 4 additions & 4 deletions nix/packages/clawdis-app.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

stdenvNoCC.mkDerivation {
pname = "clawdis-app";
version = "2.0.0-beta4";
version = "2.0.0-beta5";

src = fetchzip {
url = "https://github.com/steipete/clawdis/releases/download/v2.0.0-beta4/Clawdis-2.0.0-beta4.zip";
hash = "sha256-Oa7cejVFfZtJBSmjDaRjqocVyXo+WeS/xucGpJFDzIg=";
url = "https://github.com/steipete/clawdis/releases/download/v2.0.0-beta5/Clawdis-2.0.0-beta5.zip";
hash = "sha256-AA4REVpADWO5guUdrF5rsVTY4RhzV6cLv6hbcnS6W9M=";
stripRoot = false;
};

Expand All @@ -18,7 +18,7 @@ stdenvNoCC.mkDerivation {
installPhase = ''
runHook preInstall
mkdir -p $out/Applications
app_path="$(find "$src" -maxdepth 2 -name 'Clawdis.app' -print -quit)"
app_path="$(find "$src" -maxdepth 2 -path "$src/__MACOSX" -prune -o -name 'Clawdis.app' -print -quit)"
if [ -z "$app_path" ]; then
echo "Clawdis.app not found in $src" >&2
exit 1
Expand Down
2 changes: 1 addition & 1 deletion nix/packages/clawdis-batteries.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}:

buildEnv {
name = "clawdis-2.0.0-beta4";
name = "clawdis-2.0.0-beta5";
paths = [ clawdis-gateway clawdis-app ] ++ extendedTools;
pathsToLink = [ "/bin" "/Applications" ];

Expand Down
2 changes: 1 addition & 1 deletion nix/packages/clawdis-gateway.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ assert gatewaySrc == null || pnpmDepsHash != null;

stdenv.mkDerivation (finalAttrs: {
pname = "clawdis-gateway";
version = "2.0.0-beta4";
version = "2.0.0-beta5";

src = if gatewaySrc != null then gatewaySrc else fetchFromGitHub sourceInfo;

Expand Down