Allow passing reference-lock-file for flakes

This commit is contained in:
Rucadi 2024-04-24 13:58:11 +00:00
parent bfa7c06436
commit 59a1ffd1e8
3 changed files with 8 additions and 1 deletions

View file

@ -303,7 +303,7 @@ _home-manager_completions ()
"-L" "--print-build-logs" \ "-L" "--print-build-logs" \
"--show-trace" "--flake" "--substitute" "--builders" "--version" \ "--show-trace" "--flake" "--substitute" "--builders" "--version" \
"--update-input" "--override-input" "--experimental-features" \ "--update-input" "--override-input" "--experimental-features" \
"--extra-experimental-features" "--refresh") "--extra-experimental-features" "--reference-lock-file" "--refresh")
# ^ « home-manager »'s options. # ^ « home-manager »'s options.

View file

@ -26,6 +26,7 @@ _arguments \
'--update-input[update flake input]:NAME:()' \ '--update-input[update flake input]:NAME:()' \
'--experimental-features[set experimental Nix features]:VALUE:()' \ '--experimental-features[set experimental Nix features]:VALUE:()' \
'--extra-experimental-features:[append to experimental Nix features]:VALUE:()' \ '--extra-experimental-features:[append to experimental Nix features]:VALUE:()' \
'--reference-lock-file[flake.lock path]:VALUE:()' \
'1: :->cmds' \ '1: :->cmds' \
'*:: :->args' && ret=0 '*:: :->args' && ret=0
@ -70,6 +71,7 @@ case "$state" in
'--override-input[override flake input]:NAME VALUE:()' \ '--override-input[override flake input]:NAME VALUE:()' \
'--update-input[update flake input]:NAME:()' \ '--update-input[update flake input]:NAME:()' \
'--experimental-features[set experimental Nix features]:VALUE:()' \ '--experimental-features[set experimental Nix features]:VALUE:()' \
'--reference-lock-file[flake.lock path]:VALUE:()' \
'--extra-experimental-features:[append to experimental Nix features]:VALUE:()' '--extra-experimental-features:[append to experimental Nix features]:VALUE:()'
;; ;;
init) init)

View file

@ -1003,6 +1003,11 @@ while [[ $# -gt 0 ]]; do
PASSTHROUGH_OPTS+=("$opt" "$1") PASSTHROUGH_OPTS+=("$opt" "$1")
shift shift
;; ;;
--reference-lock-file)
[[ -v 1 && $1 != -* ]] || errMissingOptArg "$opt"
PASSTHROUGH_OPTS+=("$opt" "$1")
shift
;;
--extra-experimental-features) --extra-experimental-features)
[[ -v 1 && $1 != -* ]] || errMissingOptArg "$opt" [[ -v 1 && $1 != -* ]] || errMissingOptArg "$opt"
PASSTHROUGH_OPTS+=("$opt" "$1") PASSTHROUGH_OPTS+=("$opt" "$1")