Nix : Fix autocomplete.

This commit is contained in:
Dmitry Voronin 2024-02-07 20:55:24 +03:00
parent c87b82bd63
commit d87cf56675

View file

@ -97,7 +97,7 @@ alias tmpshell="nix_tmpshell"
# Autocomplete with available hosts.
function _comp_hosts() {
local IFS=$'\n'
local targets=($(ls --classify ~/.config/linux/system/ | grep /$ | sed -e "s/\/$//"))
local targets=($(ls ~/.config/linux/system/host/))
_autocomplete_first ${targets[@]}
}
@ -110,5 +110,5 @@ function _comp_shells() {
_autocomplete_first ${targets[@]}
}
complete -F _comp_hosts nix_update nix_upgrade
complete -F _comp_hosts nix_update nix_switch nix_rebuild
complete -F _comp_shells nix_shell shell