mirror of
https://github.com/harivansh-afk/nix.git
synced 2026-04-17 07:03:30 +00:00
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:
parent
2a79a099c1
commit
8ad1784a82
7 changed files with 172 additions and 74 deletions
23
home/netty-worktree.nix
Normal file
23
home/netty-worktree.nix
Normal 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
|
||||
}
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue