Files
nixpkgs/nixos/modules/programs/git-worktree-switcher.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

42 lines
959 B
Nix

{
config,
pkgs,
lib,
...
}:
let
cfg = config.programs.git-worktree-switcher;
initScript =
shell:
if (shell == "fish") then
''
${lib.getExe cfg.package} init ${shell} | source
''
else
''
eval "$(${lib.getExe cfg.package} init ${shell})"
'';
in
{
options = {
programs.git-worktree-switcher = {
enable = lib.mkEnableOption "git-worktree-switcher, switch between git worktrees with speed.";
package = lib.mkPackageOption pkgs "git-worktree-switcher" { };
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [ git-worktree-switcher ];
programs.bash.interactiveShellInit = initScript "bash";
programs.zsh.interactiveShellInit = lib.optionalString config.programs.zsh.enable (
initScript "zsh"
);
programs.fish.interactiveShellInit = lib.optionalString config.programs.fish.enable (
initScript "fish"
);
};
}