Add netty worktree helpers

Add netty-specific worktree helper commands and a zsh wrapper that creates sibling worktrees and cds into them.

Also split script packaging so Darwin keeps the existing wt integration while netty gets git-worktree-based helpers.

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Harivansh Rathi 2026-03-30 16:37:46 +00:00
parent 2a79a099c1
commit 8ad1784a82
7 changed files with 172 additions and 74 deletions

23
home/netty-worktree.nix Normal file
View file

@ -0,0 +1,23 @@
{
config,
lib,
pkgs,
...
}: let
customScripts = import ../scripts {inherit config lib pkgs;};
in {
home.packages = builtins.attrValues customScripts.nettyPackages;
programs.zsh.initContent = lib.mkAfter ''
wtc() {
if [[ $# -ne 1 ]]; then
printf 'usage: wtc <worktree-name>\n' >&2
return 1
fi
local worktree_path
worktree_path=$(command wt-create "$1") || return
cd -- "$worktree_path" || return
}
'';
}