Remove beads/gastown/perles/dolt
This commit is contained in:
@@ -5,27 +5,6 @@ with lib;
|
||||
let
|
||||
cfg = config.home.roles.development;
|
||||
|
||||
# Build beads and gastown from flake inputs using shared package definitions
|
||||
beadsRev = builtins.substring 0 8 (globalInputs.beads.rev or "unknown");
|
||||
beadsPackage = pkgs.callPackage ../../../packages/beads {
|
||||
src = globalInputs.beads;
|
||||
version = "0.52.0-${beadsRev}";
|
||||
};
|
||||
|
||||
gastownRev = builtins.substring 0 8 (globalInputs.gastown.rev or "unknown");
|
||||
gastownPackage = pkgs.callPackage ../../../packages/gastown {
|
||||
src = globalInputs.gastown;
|
||||
version = "unstable-${gastownRev}";
|
||||
};
|
||||
|
||||
# Build perles from flake input using shared package definition
|
||||
perlesRev = builtins.substring 0 8 (globalInputs.perles.rev or "unknown");
|
||||
perlesPackage = pkgs.callPackage ../../../packages/perles {
|
||||
inherit (pkgs.unstable) buildGoModule;
|
||||
src = globalInputs.perles;
|
||||
version = "unstable-${perlesRev}";
|
||||
};
|
||||
|
||||
# Fetch the claude-plugins repository (for humanlayer commands/agents)
|
||||
# Update the rev to get newer versions of the commands
|
||||
claudePluginsRepo = builtins.fetchGit {
|
||||
@@ -64,13 +43,8 @@ in
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [
|
||||
beadsPackage
|
||||
gastownPackage
|
||||
perlesPackage
|
||||
pkgs.unstable.claude-code
|
||||
pkgs.unstable.claude-code-router
|
||||
pkgs.unstable.codex
|
||||
pkgs.unstable.dolt
|
||||
pkgs.sqlite
|
||||
|
||||
# Custom packages
|
||||
@@ -129,72 +103,11 @@ in
|
||||
fi
|
||||
done
|
||||
|
||||
# Copy local commands from this repo (with retry for race conditions with running Claude)
|
||||
for file in ${./commands}/*.md; do
|
||||
if [ -f "$file" ]; then
|
||||
filename=$(basename "$file" .md)
|
||||
dest="$HOME/.claude/commands/''${filename}.md"
|
||||
# Remove existing file first, then copy with retry on failure
|
||||
rm -f "$dest" 2>/dev/null || true
|
||||
if ! cp "$file" "$dest" 2>/dev/null; then
|
||||
sleep 0.5
|
||||
cp "$file" "$dest" || echo "Warning: Failed to copy $filename.md to commands"
|
||||
fi
|
||||
chmod u+w "$dest" 2>/dev/null || true
|
||||
fi
|
||||
done
|
||||
|
||||
# Copy local skills (reference materials) to skills subdirectory
|
||||
mkdir -p ~/.claude/commands/skills
|
||||
for file in ${./skills}/*.md; do
|
||||
if [ -f "$file" ]; then
|
||||
filename=$(basename "$file" .md)
|
||||
dest="$HOME/.claude/commands/skills/''${filename}.md"
|
||||
rm -f "$dest" 2>/dev/null || true
|
||||
if ! cp "$file" "$dest" 2>/dev/null; then
|
||||
sleep 0.5
|
||||
cp "$file" "$dest" || echo "Warning: Failed to copy $filename.md to skills"
|
||||
fi
|
||||
chmod u+w "$dest" 2>/dev/null || true
|
||||
fi
|
||||
done
|
||||
|
||||
# Copy micro-skills (compact reusable knowledge referenced by formulas)
|
||||
for file in ${./skills/micro}/*.md; do
|
||||
if [ -f "$file" ]; then
|
||||
dest="$HOME/.claude/commands/skills/$(basename "$file")"
|
||||
rm -f "$dest" 2>/dev/null || true
|
||||
cp "$file" "$dest"
|
||||
chmod u+w "$dest" 2>/dev/null || true
|
||||
fi
|
||||
done
|
||||
|
||||
# Install beads formulas to user-level formula directory
|
||||
mkdir -p ~/.beads/formulas
|
||||
for file in ${./formulas}/*.formula.toml; do
|
||||
if [ -f "$file" ]; then
|
||||
dest="$HOME/.beads/formulas/$(basename "$file")"
|
||||
rm -f "$dest" 2>/dev/null || true
|
||||
cp "$file" "$dest"
|
||||
chmod u+w "$dest" 2>/dev/null || true
|
||||
fi
|
||||
done
|
||||
|
||||
$DRY_RUN_CMD echo "Claude Code plugins installed: humanlayer commands/agents + local commands + local skills + formulas"
|
||||
'';
|
||||
|
||||
# Set up beads Claude Code integration (hooks for SessionStart/PreCompact)
|
||||
# This uses the CLI + hooks approach which is recommended over MCP for Claude Code
|
||||
home.activation.claudeCodeBeadsSetup = lib.hm.dag.entryAfter ["writeBoundary" "claudeCodeCommands"] ''
|
||||
# Run bd setup claude to install hooks into ~/.claude/settings.json
|
||||
# This is idempotent - safe to run multiple times
|
||||
${beadsPackage}/bin/bd setup claude 2>/dev/null || true
|
||||
|
||||
$DRY_RUN_CMD echo "Claude Code beads integration configured (hooks installed)"
|
||||
$DRY_RUN_CMD echo "Claude Code plugins installed: humanlayer commands/agents"
|
||||
'';
|
||||
|
||||
# Configure Claude Code statusline (merge into existing settings.json)
|
||||
home.activation.claudeCodeStatusLine = lib.hm.dag.entryAfter ["writeBoundary" "claudeCodeBeadsSetup"] ''
|
||||
home.activation.claudeCodeStatusLine = lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||
SETTINGS="$HOME/.claude/settings.json"
|
||||
mkdir -p "$HOME/.claude"
|
||||
if [ -f "$SETTINGS" ]; then
|
||||
@@ -205,46 +118,6 @@ in
|
||||
$DRY_RUN_CMD echo "Claude Code statusline configured"
|
||||
'';
|
||||
|
||||
# Beads timer gate checker (Linux only - uses systemd)
|
||||
# Runs every 5 minutes to auto-resolve expired timer gates across all beads projects
|
||||
# This enables self-scheduling molecules (watchers, patrols, etc.)
|
||||
systemd.user.services.beads-gate-check = lib.mkIf pkgs.stdenv.isLinux {
|
||||
Unit = {
|
||||
Description = "Check and resolve expired beads timer gates";
|
||||
};
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
# Check gates in all workspaces that have running daemons
|
||||
ExecStart = pkgs.writeShellScript "beads-gate-check-all" ''
|
||||
# Get list of workspaces from daemon registry
|
||||
workspaces=$(${beadsPackage}/bin/bd daemon list --json 2>/dev/null | ${pkgs.jq}/bin/jq -r '.[].workspace // empty' 2>/dev/null)
|
||||
|
||||
if [ -z "$workspaces" ]; then
|
||||
exit 0 # No beads workspaces, nothing to do
|
||||
fi
|
||||
|
||||
for ws in $workspaces; do
|
||||
if [ -d "$ws" ]; then
|
||||
cd "$ws" && ${beadsPackage}/bin/bd gate check --type=timer --quiet 2>/dev/null || true
|
||||
fi
|
||||
done
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.timers.beads-gate-check = lib.mkIf pkgs.stdenv.isLinux {
|
||||
Unit = {
|
||||
Description = "Periodic beads timer gate check";
|
||||
};
|
||||
Timer = {
|
||||
OnBootSec = "5min";
|
||||
OnUnitActiveSec = "5min";
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [ "timers.target" ];
|
||||
};
|
||||
};
|
||||
|
||||
# Note: modules must be imported at top-level home config
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user