Skip to content
Merged
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
18 changes: 17 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,23 @@ nix-build: nix-connect nix-trust ## Build Nix configuration.
echo "❌ Unsupported system architecture: $(OS) $(ARCH)"; \
exit 1; \
elif [ "$(OS)" = "Darwin" ]; then \
$(NIX_ALLOW_UNFREE) $(NIX_EXEC) build .#$(NIX_CONFIG_TYPE).$(NIX_SYSTEM).system $(NIX_FLAGS) --impure --show-trace; \
if [ -n "$(HOST)" ]; then \
case " $(NIXOS_NAMED_HOSTS) " in \
*" $(HOST) "*) \
echo "Building named NixOS host: $(HOST)"; \
$(NIX_ALLOW_UNFREE) $(NIX_EXEC) build .#nixosConfigurations.$(HOST).config.system.build.toplevel $(NIX_FLAGS) --impure --show-trace; \
;; \
*) \
echo "Building named Darwin host: $(HOST)"; \
$(NIX_ALLOW_UNFREE) $(NIX_EXEC) build .#darwinConfigurations.$(HOST).system $(NIX_FLAGS) --impure --show-trace; \
;; \
esac; \
elif [ -n "$(DETECTED_HOST)" ]; then \
echo "Auto-detected host: $(DETECTED_HOST)"; \
$(NIX_ALLOW_UNFREE) $(NIX_EXEC) build .#darwinConfigurations.$(DETECTED_HOST).system $(NIX_FLAGS) --impure --show-trace; \
else \
$(NIX_ALLOW_UNFREE) $(NIX_EXEC) build .#$(NIX_CONFIG_TYPE).$(NIX_SYSTEM).system $(NIX_FLAGS) --impure --show-trace; \
fi; \
elif [ "$(NIX_CONFIG_TYPE)" = "nixosConfigurations" ]; then \
if [ -n "$(HOST)" ]; then \
echo "Building named host: $(HOST)"; \
Expand Down
952 changes: 510 additions & 442 deletions bun.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions home-manager/programs/bash/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
};

shellAliases = {
copy = "clipboard-copy";
paste = "clipboard-paste";
rm = "gomi";
};

Expand Down
8 changes: 4 additions & 4 deletions home-manager/programs/fish/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,12 @@
fish_vi_key_bindings
'';
shellAliases = {
copy = "clipboard-copy";
neofetch = "fastfetch";
ocd = "bun run ${config.home.homeDirectory}/ghq/github.com/shunkakinoki/open-composer/apps/cli/src/index.ts";
paste = "clipboard-paste";
};
shellAbbrs = {
cat = "bat";
copy = "~/.local/scripts/clipboard-copy";
paste = "~/.local/scripts/clipboard-paste";
e = "nvim";
g = "git";
j = "jj";
Expand Down Expand Up @@ -211,6 +210,7 @@
value.source = ./functions/${name}.fish;
})
[
"__tmux_bootstrap_default_session"
"_cliproxyapi_function"
"_clrc_function"
"_cltxe_function"
Expand Down Expand Up @@ -258,7 +258,6 @@
"_pixeh_function"
"_ssh_add_github"
"_sync_local_binaries_function"
"_update_local_binaries_function"
"_tdo_function"
"_tmo_function"
"_tpo_function"
Expand All @@ -268,6 +267,7 @@
"_tsw_function"
"_two_function"
"_tzo_function"
"_update_local_binaries_function"
"_vpn_function"
"_zdo_function"
"_zmo_function"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
function __tmux_bootstrap_default_session --description "Create built-in tmux sessions without tmuxinator"
set -l session_name $argv[1]
set -l dotfiles_root ~/dotfiles

switch $session_name
case primary mobile desktop
tmux new-session -d -s $session_name -n btop
if test $status -ne 0
tmux has-session -t $session_name 2>/dev/null
return $status
end

if not begin
tmux send-keys -t $session_name:0 btop C-m
and tmux new-window -c $dotfiles_root -t $session_name:1 -n dotfiles
and tmux split-window -c $dotfiles_root -t $session_name:1
and tmux select-layout -t $session_name:1 even-horizontal
and tmux new-window -t $session_name:2 -n $session_name
and tmux select-window -t $session_name:0
and tmux select-pane -t $session_name:0.0
end
tmux kill-session -t $session_name 2>/dev/null
return 1
end

case work
tmux new-session -d -s work -n editor
if test $status -ne 0
tmux has-session -t work 2>/dev/null
return $status
end

if not begin
tmux send-keys -t work:0 nvim C-m
and tmux new-window -t work:1 -n shell
and tmux new-window -t work:2 -n work
and tmux select-window -t work:0
and tmux select-pane -t work:0.0
end
tmux kill-session -t work 2>/dev/null
return 1
end

case '*'
echo "Unknown built-in tmux session '$session_name'" >&2
return 1
end
end
9 changes: 8 additions & 1 deletion home-manager/programs/fish/functions/_tdo_function.fish
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ function _tdo_function --description "Attach to tmux desktop session"
end
tmux attach-session -t desktop
else
tmuxinator start desktop
__tmux_bootstrap_default_session desktop
or return 1

if test -n "$TMUX"
tmux switch-client -t desktop
else
tmux attach-session -t desktop
end
end
end
9 changes: 8 additions & 1 deletion home-manager/programs/fish/functions/_tmo_function.fish
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ function _tmo_function --description "Attach to tmux mobile session"
end
tmux attach-session -t mobile
else
tmuxinator start mobile
__tmux_bootstrap_default_session mobile
or return 1

if test -n "$TMUX"
tmux switch-client -t mobile
else
tmux attach-session -t mobile
end
end
end
9 changes: 8 additions & 1 deletion home-manager/programs/fish/functions/_tpo_function.fish
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ function _tpo_function --description "Attach to tmux primary session"
end
tmux attach-session -t primary
else
tmuxinator start primary
__tmux_bootstrap_default_session primary
or return 1

if test -n "$TMUX"
tmux switch-client -t primary
else
tmux attach-session -t primary
end
end
end
24 changes: 9 additions & 15 deletions home-manager/programs/fish/functions/_tss_function.fish
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,16 @@ function _tss_function --description "Fuzzy-pick or create a tmux session"
tmux attach-session -t "$selected"
end
else if test "$selected" = work
set -l restore (tmux list-keys 2>/dev/null | string match -rg '(/\S+/resurrect/scripts/restore\.sh)')
set -l restore $restore[1]
if test -n "$restore"
tmux run-shell "$restore"
end
if tmux has-session -t work 2>/dev/null
if test -n "$TMUX"
tmux switch-client -t work
else
tmux attach-session -t work
end
else
tmuxinator start work
end
_two_function
else if contains $selected $default_sessions
tmuxinator start "$selected"
switch $selected
case primary
_tpo_function
case mobile
_tmo_function
case desktop
_tdo_function
end
else
tmux new-session -d -s "$selected"
if test -n "$TMUX"
Expand Down
45 changes: 31 additions & 14 deletions home-manager/programs/fish/functions/_two_function.fish
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,46 @@ function _two_function --description "Attach to tmux work session"
return
end

# No tmux server or no work session — start server and let continuum restore
set -l restore (tmux list-keys 2>/dev/null | string match -rg '(/\S+/resurrect/scripts/restore\.sh)')
set -l restore $restore[1]
set -l bootstrapped 0

# Start a server if needed so we can invoke the restore script.
if not tmux list-sessions 2>/dev/null | grep -q .
# No server running — start one; continuum will auto-restore work session
tmux new-session -d -s _bootstrap
# Give continuum a moment to restore
sleep 3
if tmux has-session -t work 2>/dev/null
tmux kill-session -t _bootstrap 2>/dev/null
if test -n "$TMUX"
tmux switch-client -t work
else
tmux attach-session -t work
set bootstrapped 1
end

if test -n "$restore"
Comment on lines +11 to +21

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.

high

The detection of the tmux-resurrect restore script happens before ensuring the tmux server is running. If the server is not already active, tmux list-keys will fail, and the restore variable will be empty. Consequently, the subsequent attempt to restore the session (lines 21-38) will be skipped even if a restore script is configured. The detection should be moved after the bootstrap session is created to ensure the server is reachable.

  set -l bootstrapped 0

  # Start a server if needed so we can invoke the restore script.
  if not tmux list-sessions 2>/dev/null | grep -q .
    tmux new-session -d -s _bootstrap
    set bootstrapped 1
  end

  set -l restore (tmux list-keys 2>/dev/null | string match -rg '(/\S+/resurrect/scripts/restore\.sh)')
  set -l restore $restore[1]

  if test -n "$restore"

tmux run-shell "$restore"
# Give tmux-resurrect a moment to recreate the work session.
for _i in (seq 1 50)
if tmux has-session -t work 2>/dev/null
if test $bootstrapped -eq 1
tmux kill-session -t _bootstrap 2>/dev/null
end
if test -n "$TMUX"
tmux switch-client -t work
else
tmux attach-session -t work
end
return
end
return
sleep 0.1
end
end

if test $bootstrapped -eq 1
tmux kill-session -t _bootstrap 2>/dev/null
end

# Continuum didn't restore work — fall back to tmuxinator
# Restore didn't produce work — fall back to the built-in session bootstrap.
__tmux_bootstrap_default_session work
or return 1

if test -n "$TMUX"
TMUX= tmuxinator start work --no-attach 2>/dev/null
tmux switch-client -t work
else
tmuxinator start work
tmux attach-session -t work
end
end
2 changes: 2 additions & 0 deletions home-manager/programs/zsh/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
fi

# Define aliases in .zshenv so non-interactive zsh invocations can use them.
alias copy='clipboard-copy'
alias paste='clipboard-paste'
alias rm='gomi'
'';

Expand Down
50 changes: 25 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,66 +11,66 @@
"license": "ISC",
"packageManager": "bun@1.3.0",
"dependencies": {
"@anthropic-ai/claude-code": "^2.1.104",
"@augmentcode/auggie": "^0.23.0",
"@biomejs/biome": "^2.4.11",
"@anthropic-ai/claude-code": "^2.1.109",
"@augmentcode/auggie": "^0.24.0",
"@biomejs/biome": "^2.4.12",
"@ccusage/amp": "^18.0.10",
"@ccusage/codex": "^18.0.10",
"@ccusage/mcp": "^18.0.10",
"@ccusage/opencode": "^18.0.10",
"@ccusage/pi": "^18.0.10",
"@fission-ai/openspec": "^1.3.0",
"@getgrit/cli": "^0.1.0-alpha.1743007075",
"@github/copilot": "^1.0.24",
"@google/gemini-cli": "^0.37.1",
"@github/copilot": "^1.0.27",
"@google/gemini-cli": "^0.38.0",
"@google/jules": "^0.1.42",
"@googleworkspace/cli": "^0.22.5",
"@kaitranntt/ccs": "^7.68.1",
"@mariozechner/pi-coding-agent": "^0.66.1",
"@nanocollective/nanocoder": "^1.24.1",
"@oh-my-pi/pi-coding-agent": "^14.1.0",
"@oh-my-pi/pi-natives": "^14.1.0",
"@kaitranntt/ccs": "^7.71.0",
"@mariozechner/pi-coding-agent": "^0.67.2",
"@nanocollective/nanocoder": "^1.25.2",
"@oh-my-pi/pi-coding-agent": "^14.1.2",
"@oh-my-pi/pi-natives": "^14.1.2",
"@oh-my-pi/swarm-extension": "^13.17.0",
"@openai/codex": "^0.120.0",
"@pencil.dev/cli": "^0.2.4",
"@pencil.dev/cli": "^0.2.5",
"@pkieltyka/gitgenie": "^0.1.2",
"@pulumi/pulumi": "^3.230.0",
"@schpet/linear-cli": "^2.0.0",
"@sourcegraph/amp": "^0.0.1775981571-g834e73",
"@sourcegraph/amp": "^0.0.1776259771-gf274cb",
"@steipete/bird": "^0.8.0",
"@tobilu/qmd": "^2.1.0",
"@traces-sh/traces": "^0.4.17",
"@typescript/native-preview": "^7.0.0-dev.20260412.1",
"@upstash/context7-mcp": "^2.1.7",
"@traces-sh/traces": "^0.5.0",
"@typescript/native-preview": "^7.0.0-dev.20260415.1",
"@upstash/context7-mcp": "^2.1.8",
"@vibe-kit/grok-cli": "^0.0.34",
"acpx": "^0.5.3",
"agent-browser": "^0.25.3",
"agentcash": "^0.13.8",
"agent-browser": "^0.25.4",
"agentcash": "^0.14.0",
"btca": "^2.0.5",
"ccusage": "^18.0.10",
"chrome-devtools-axi": "^0.1.15",
"chrome-devtools-mcp": "^0.21.0",
"clawdhub": "^0.3.0",
"cline": "^2.14.0",
"droid": "^0.99.0",
"get-shit-done-cc": "^1.34.2",
"gh-axi": "^0.1.11",
"droid": "^0.101.0",
"get-shit-done-cc": "^1.36.0",
"gh-axi": "^0.1.12",
"mcp-remote": "^0.1.38",
"mcporter": "^0.8.1",
"obsidian-headless": "^0.0.8",
"open-composer": "^0.8.23",
"openclaw": "^2026.4.11",
"oxfmt": "^0.44.0",
"oxlint": "^1.59.0",
"openclaw": "^2026.4.14",
"oxfmt": "^0.45.0",
"oxlint": "^1.60.0",
"paperclipai": "^2026.403.0",
"playwright-chromium": "^1.59.1",
"portless": "^0.10.1",
"portless": "^0.10.2",
"ralph-tui": "^0.11.0",
"takt": "^0.35.4",
"turbo": "^2.9.6",
"typescript": "^6.0.2",
"vite": "^8.0.8",
"vite-plus": "^0.1.16",
"vite-plus": "^0.1.18",
"xcodebuildmcp": "^2.3.2"
},
"overrides": {
Expand Down
Loading
Loading