git-worktree-switcher: init at 0.2.4 (#355484)

authored by Leona Maroni and committed by GitHub 2e5a764e e9eff470

+145
+12
maintainers/maintainer-list.nix
··· 10519 10519 githubId = 1476865; 10520 10520 name = "jigglycrumb"; 10521 10521 }; 10522 + jiriks74 = { 10523 + name = "Jiří Štefka"; 10524 + email = "jiri@stefka.eu"; 10525 + github = "jiriks74"; 10526 + githubId = 54378412; 10527 + matrix = "@jiriks74:matrix.org"; 10528 + keys = [ 10529 + { 10530 + fingerprint = "563AC7887FD6414714A6ACAC1D5E30D3DB2264DE"; 10531 + } 10532 + ]; 10533 + }; 10522 10534 jirkamarsik = { 10523 10535 email = "jiri.marsik89@gmail.com"; 10524 10536 github = "jirkamarsik";
+2
nixos/doc/manual/release-notes/rl-2505.section.md
··· 34 34 35 35 - [KanBoard](https://github.com/kanboard/kanboard), a project management tool that focuses on the Kanban methodology. Available as [services.kanboard](#opt-services.kanboard.enable). 36 36 37 + - [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) 38 + 37 39 <!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. --> 38 40 39 41 ## Backward Incompatibilities {#sec-release-25.05-incompatibilities}
+1
nixos/modules/module-list.nix
··· 207 207 ./programs/gdk-pixbuf.nix 208 208 ./programs/geary.nix 209 209 ./programs/git.nix 210 + ./programs/git-worktree-switcher.nix 210 211 ./programs/gnome-disks.nix 211 212 ./programs/gnome-terminal.nix 212 213 ./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 + }
+30
pkgs/by-name/gi/git-worktree-switcher/disable-update.patch
··· 1 + diff --git a/wt b/wt 2 + index 60999f2..5687822 100755 3 + --- a/wt 4 + +++ b/wt 5 + @@ -27,7 +27,6 @@ help_message() { 6 + echo -e "\twt: go to the main worktree" 7 + echo -e "\twt <worktree-name>: search for worktree names and change to that directory." 8 + echo -e "\twt names: list out only the git worktree names." 9 + - echo -e "\twt update: update to the latest release of worktree switcher." 10 + echo -e "\twt version: show the CLI version." 11 + echo -e "\twt init <shell>: print the init script for <shell>." 12 + echo -e "\twt help: shows this help message." 13 + @@ -163,9 +162,6 @@ case "${args[0]}" in 14 + names) 15 + worktree_list_names 16 + ;; 17 + -update) 18 + - update 19 + - ;; 20 + help) 21 + help_message 22 + ;; 23 + @@ -176,7 +172,6 @@ init) 24 + init 25 + ;; 26 + *) 27 + - auto_check_update 28 + directory=$(git worktree list --porcelain 2> /dev/null | sed -n '/'"${arg:-.}"'/{s/^worktree\s*//p;q}') 29 + ;; 30 + esac
+60
pkgs/by-name/gi/git-worktree-switcher/package.nix
··· 1 + { 2 + lib, 3 + stdenv, 4 + fetchFromGitHub, 5 + makeWrapper, 6 + installShellFiles, 7 + git, 8 + jq, 9 + }: 10 + 11 + stdenv.mkDerivation (finalAttrs: { 12 + pname = "git-worktree-switcher"; 13 + version = "0.2.4"; 14 + 15 + src = fetchFromGitHub { 16 + owner = "mateusauler"; 17 + repo = "git-worktree-switcher"; 18 + rev = "refs/tags/${finalAttrs.version}-fork"; 19 + hash = "sha256-N+bDsLEUM6FWhyliUav2n5hwMa5EEuVPoIK+Cja0DxA="; 20 + }; 21 + 22 + buildInputs = [ 23 + jq 24 + git 25 + ]; 26 + 27 + nativeBuildInputs = [ 28 + makeWrapper 29 + installShellFiles 30 + ]; 31 + 32 + patches = [ 33 + ./disable-update.patch # Disable update and auto update functionality 34 + ]; 35 + 36 + installPhase = '' 37 + mkdir -p $out/bin 38 + 39 + cp wt $out/bin 40 + wrapProgram $out/bin/wt --prefix PATH : ${ 41 + lib.makeBinPath [ 42 + git 43 + jq 44 + ] 45 + } 46 + 47 + installShellCompletion --zsh completions/_wt_completion 48 + installShellCompletion --bash completions/wt_completion 49 + installShellCompletion --fish completions/wt.fish 50 + ''; 51 + 52 + meta = { 53 + homepage = "https://github.com/mateusauler/git-worktree-switcher"; 54 + description = "Switch between git worktrees with speed."; 55 + license = lib.licenses.mit; 56 + platforms = lib.platforms.all; 57 + mainProgram = "wt"; 58 + maintainers = with lib.maintainers; [ jiriks74 ]; 59 + }; 60 + })