mirror of
https://github.com/harivansh-afk/nix.git
synced 2026-04-15 09:01:16 +00:00
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>
23 lines
475 B
Nix
23 lines
475 B
Nix
{
|
|
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
|
|
}
|
|
'';
|
|
}
|