fish: ensure generated completions considered last

home-manager's generated completions shadow built-in completion scripts.
fish actually has logic to deal with this when the path ends with
/generated_completions, so let's take advantage of it.

Link: 47c773300a/src/autoload.rs (L421-L424)
This commit is contained in:
novenary 2025-11-30 23:02:35 +02:00 committed by Austin Horstman
parent 13b089b586
commit e4e25a8c31
19 changed files with 20 additions and 20 deletions

View file

@ -645,7 +645,7 @@ in
# Support completion for `man` by building a cache for `apropos`.
programs.man.generateCaches = lib.mkDefault true;
xdg.dataFile."fish/home-manager_generated_completions".source =
xdg.dataFile."fish/home-manager/generated_completions".source =
let
# Paths later in the list will overwrite those already linked
destructiveSymlinkJoin =
@ -696,7 +696,7 @@ in
set -l post_joined (string replace $prev_joined "" $joined)
set -l prev (string split " " (string trim $prev_joined))
set -l post (string split " " (string trim $post_joined))
set fish_complete_path $prev "${config.xdg.dataHome}/fish/home-manager_generated_completions" $post
set fish_complete_path $prev "${config.xdg.dataHome}/fish/home-manager/generated_completions" $post
end
'';
}