Skip to content

Commit 4644e34

Browse files
committed
Use Nix fetchFromGitHub for linear commands integration
- Replace activation script with declarative Nix approach - Use fetchFromGitHub to automatically download and sync linear commands - Commands will be available at ~/.claude/commands/linear/ - Hash-pinned for reproducible builds
1 parent ff18e3b commit 4644e34

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

common/claude-code/default.nix

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,19 @@
2222
home.file.".claude/settings.json".source = ./settings.json;
2323
home.file.".claude/CLAUDE.md".source = ./CLAUDE.md;
2424
home.file.".claude/commands".source = ./commands;
25+
26+
# Fetch and sync linear commands
27+
home.file.".claude/commands/linear".source = pkgs.fetchFromGitHub {
28+
owner = "svnlto";
29+
repo = "claude-code-linear-commands";
30+
rev = "main";
31+
sha256 = "sha256-07zl1yfb1pvkyk0kqhdw7z5dpi8078jdybnm0gzwjb13hxk17s21";
32+
} + "/commands";
2533

2634
# Create necessary directories
2735
home.file.".claude/.keep".text = "";
2836

29-
# Install Claude Code and sync linear commands on activation
37+
# Install Claude Code on activation
3038
home.activation.installClaudeCode = lib.hm.dag.entryAfter ["writeBoundary"] ''
3139
PATH="${pkgs.nodejs_22}/bin:$PATH"
3240
export NPM_CONFIG_PREFIX="$HOME/.npm-global"
@@ -37,19 +45,6 @@
3745
else
3846
echo "Claude Code is already installed at $(which claude)"
3947
fi
40-
41-
# Clone and sync linear commands
42-
echo "Syncing Claude Code Linear commands..."
43-
TEMP_DIR=$(mktemp -d)
44-
if ${pkgs.git}/bin/git clone https://github.com/svnlto/claude-code-linear-commands.git "$TEMP_DIR" >/dev/null 2>&1; then
45-
mkdir -p "$HOME/.claude/commands/linear"
46-
cp "$TEMP_DIR/commands/"* "$HOME/.claude/commands/linear/" 2>/dev/null || true
47-
rm -rf "$TEMP_DIR"
48-
echo "Linear commands synced to ~/.claude/commands/linear/"
49-
else
50-
echo "Warning: Failed to sync linear commands"
51-
rm -rf "$TEMP_DIR"
52-
fi
5348
'';
5449

5550
}

0 commit comments

Comments
 (0)