-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
109 lines (89 loc) · 3.74 KB
/
Copy pathjustfile
File metadata and controls
109 lines (89 loc) · 3.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# Dotfiles maintenance commands
#
# Two-repo setup:
# ~/dotfiles - public, shared across all machines (home default)
# ~/.dotfiles-local - private, work-only overrides (only stowed on work machine)
#
# OpenCode config strategy:
# Global (~/.config/opencode/opencode.jsonc) is symlinked from ~/dotfiles
# and contains home defaults (codeberg, forgejo, dokploy, local LLMs all enabled).
# On work machines, ~/.dotfiles-local is also stowed, which drops
# opencode-work.fish into fish conf.d, setting OPENCODE_CONFIG to point at
# the work overlay (~/.dotfiles-local/.config/opencode/opencode.work.jsonc).
# That overlay disables home MCPs and adds work-only ones.
#
# Skills stow strategy:
# ~/.agents/skills/ is populated from two sources via --no-folding:
# - ~/dotfiles/.agents/skills/ (public skills)
# - ~/.dotfiles-local/.agents/skills/ (work-only skills, e.g. ado-build-logs)
# Stow invocation targets ~/.agents/skills:
# cd ~/dotfiles/.agents && stow --no-folding --ignore=node_modules --target=$HOME/.agents/skills --stow skills
# cd ~/.dotfiles-local/.agents && stow --no-folding --ignore=node_modules --target=$HOME/.agents/skills --stow skills
#
# Pi models strategy:
# ~/.pi/agent/models.json -> symlink to ~/dotfiles/.pi/agent/models.json (public/local providers)
# ~/.pi/agent/models.work.json -> symlink to ~/.dotfiles-local/.pi/agent/models.work.json (work providers)
# Set shell explicitly
set shell := ["zsh", "-c"]
# Default recipe - show available commands
default:
@just --list
# === Nix-darwin ===
# Apply nix-darwin configuration
switch:
sudo darwin-rebuild switch --flake ~/dotfiles
# Update flake inputs and rebuild
update:
nix --extra-experimental-features "nix-command flakes" flake update && just switch
# === Stow management ===
# Restow public dotfiles (fix broken symlinks)
restow:
rm -f ~/dotfiles/result
cd ~/dotfiles && stow --restow --ignore=result .
# Restow work-local dotfiles (run on work machine only)
restow-local:
cd ~/.dotfiles-local && stow --restow .
cd ~/.dotfiles-local/.agents && stow --no-folding --ignore='node_modules' --target=$HOME/.agents/skills --restow skills
# Restow both repos (work machine only)
restow-all: restow restow-local
# Check stow status for public dotfiles (simulate)
stow-check:
cd ~/dotfiles && stow --simulate . 2>&1 | grep -v "not owned by stow"
# === Git maintenance ===
# Show dotfiles status
status:
cd ~/dotfiles && git status --short
# Show recent commits
log:
cd ~/dotfiles && git log --oneline -10
# Push to remote
push:
cd ~/dotfiles && git push
# === OpenCode config ===
# Show which opencode config is active on this machine
which-config:
#!/usr/bin/env zsh
if [[ -n "$OPENCODE_CONFIG" ]]; then
echo "Work overlay active: $OPENCODE_CONFIG"
else
echo "Home/global config only: ~/.config/opencode/opencode.jsonc"
fi
echo ""
echo "Resolved symlink:"
ls -la ~/.config/opencode/opencode.jsonc 2>/dev/null || echo " Not symlinked (stow may need to run)"
# === Link verification ===
# Verify all symlinks are correct
check-links:
@echo "=== Checking ~/.config/opencode symlinks ==="
@ls -la ~/.config/opencode/ | grep -E "^l" || echo "No symlinks found"
@echo ""
@echo "=== Checking ~/.pi/agent symlinks ==="
@ls -la ~/.pi/agent/ 2>/dev/null | grep -E "^l" || echo "No symlinks found"
@echo ""
@echo "=== Checking ~/.agents skill symlinks (sample) ==="
@ls ~/.agents/ 2>/dev/null | head -5 || echo "No skills found"
@ls -la ~/.agents/ado-build-logs/SKILL.md 2>/dev/null || echo " ado-build-logs not stowed (work machine only)"
# === Full system check ===
# Run all checks
check: stow-check check-links which-config status
@echo "All checks complete."