lol

nixos/git-worktree-switcher: init git-worktree-switcher

This module sets up shells so that they work with
[git-worktree-switcher](https://github.com/mateusauler/git-worktree-switcher)

+43
+2
nixos/doc/manual/release-notes/rl-2505.section.md
··· 20 20 21 21 - [agorakit](https://github.com/agorakit/agorakit), an organization tool for citizens' collectives. Available with [services.agorakit](#opt-services.agorakit.enable). 22 22 23 + - [git-worktree-switcher](https://github.com/mateusauler/git-worktree-switcher), switch between git worktrees with speed. Available as [programs.git-worktree-switcher](#opt-programs.git-worktree-switcher.enable) 24 + 23 25 <!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. --> 24 26 25 27 ## Backward Incompatibilities {#sec-release-25.05-incompatibilities}
+1
nixos/modules/module-list.nix
··· 205 205 ./programs/gdk-pixbuf.nix 206 206 ./programs/geary.nix 207 207 ./programs/git.nix 208 + ./programs/git-worktree-switcher.nix 208 209 ./programs/gnome-disks.nix 209 210 ./programs/gnome-terminal.nix 210 211 ./programs/gnupg.nix
+40
nixos/modules/programs/git-worktree-switcher.nix
··· 1 + { 2 + config, 3 + pkgs, 4 + lib, 5 + ... 6 + }: 7 + 8 + let 9 + cfg = config.programs.git-worktree-switcher; 10 + 11 + initScript = 12 + shell: 13 + if (shell == "fish") then 14 + '' 15 + ${lib.getExe pkgs.git-worktree-switcher} init ${shell} | source 16 + '' 17 + else 18 + '' 19 + eval "$(${lib.getExe pkgs.git-worktree-switcher} init ${shell})" 20 + ''; 21 + in 22 + { 23 + options = { 24 + programs.git-worktree-switcher = { 25 + enable = lib.mkEnableOption "git-worktree-switcher, switch between git worktrees with speed."; 26 + }; 27 + }; 28 + 29 + config = lib.mkIf cfg.enable { 30 + environment.systemPackages = with pkgs; [ git-worktree-switcher ]; 31 + 32 + programs.bash.interactiveShellInit = initScript "bash"; 33 + programs.zsh.interactiveShellInit = lib.optionalString config.programs.zsh.enable ( 34 + initScript "zsh" 35 + ); 36 + programs.fish.interactiveShellInit = lib.optionalString config.programs.fish.enable ( 37 + initScript "fish" 38 + ); 39 + }; 40 + }