2021-01-02 14:07:14 +01:00
|
|
|
#compdef home-manager
|
|
|
|
|
|
|
|
local state ret=1
|
|
|
|
|
|
|
|
_arguments \
|
|
|
|
'-A[attribute]:ATTRIBUTE:()' \
|
|
|
|
'-I[search path]:PATH:_files -/' \
|
|
|
|
'-b[backup files]:EXT:()' \
|
2023-09-08 07:18:34 +02:00
|
|
|
'--flake[flake-uri]:PATH:_files -/' \
|
2021-01-02 14:07:14 +01:00
|
|
|
'--cores[cores]:NUM:()' \
|
2021-06-06 00:11:06 +02:00
|
|
|
'--debug[debug]' \
|
2021-06-20 09:19:55 +02:00
|
|
|
'--impure[impure]' \
|
2021-01-02 14:07:14 +01:00
|
|
|
'--keep-failed[keep failed]' \
|
|
|
|
'--keep-going[keep going]' \
|
2022-01-02 08:31:07 +01:00
|
|
|
'--version[version]' \
|
2021-01-02 14:07:14 +01:00
|
|
|
'(-h --help)'{--help,-h}'[help]' \
|
|
|
|
'(-v --verbose)'{--verbose,-v}'[verbose]' \
|
|
|
|
'(-n --dry-run)'{--dry-run,-n}'[dry run]' \
|
|
|
|
'(-f --file)'{--file,-f}'[configuration file]:FILE:_files' \
|
|
|
|
'(-j --max-jobs)'{--max-jobs,-j}'[max jobs]:NUM:()' \
|
|
|
|
'--option[option]:NAME VALUE:()' \
|
2021-08-17 22:53:44 +02:00
|
|
|
'--builders[builders]:SPEC:()' \
|
2022-12-25 07:48:45 +01:00
|
|
|
'(-L --print-build-logs)'{--print-build-logs,-L}'[print build logs]' \
|
2021-01-02 14:07:14 +01:00
|
|
|
'--show-trace[show trace]' \
|
2022-02-12 19:53:33 +01:00
|
|
|
'--override-input[override flake input]:NAME VALUE:()' \
|
|
|
|
'--update-input[update flake input]:NAME:()' \
|
|
|
|
'--experimental-features[set experimental Nix features]:VALUE:()' \
|
|
|
|
'--extra-experimental-features:[append to experimental Nix features]:VALUE:()' \
|
2021-01-02 14:07:14 +01:00
|
|
|
'1: :->cmds' \
|
|
|
|
'*:: :->args' && ret=0
|
|
|
|
|
|
|
|
case "$state" in
|
|
|
|
cmds)
|
|
|
|
_values 'command' \
|
|
|
|
'help[help]' \
|
|
|
|
'edit[edit]' \
|
2020-08-21 07:53:03 +02:00
|
|
|
'option[inspect option]' \
|
2021-01-02 14:07:14 +01:00
|
|
|
'build[build]' \
|
2023-02-26 23:10:06 +01:00
|
|
|
'init[init]' \
|
2021-01-02 14:07:14 +01:00
|
|
|
'switch[switch]' \
|
|
|
|
'generations[list generations]' \
|
|
|
|
'remove-generations[remove generations]' \
|
|
|
|
'expire-generations[expire generations]' \
|
|
|
|
'packages[managed packages]' \
|
|
|
|
'news[read the news]' \
|
|
|
|
'uninstall[uninstall]' && ret=0
|
|
|
|
;;
|
|
|
|
args)
|
|
|
|
case $line[1] in
|
|
|
|
remove-generations)
|
|
|
|
_values 'generations' \
|
|
|
|
$(home-manager generations | cut -d ' ' -f 5) && ret=0
|
|
|
|
;;
|
|
|
|
build|switch)
|
|
|
|
_arguments \
|
|
|
|
'--cores[cores]:NUM:()' \
|
2023-09-08 07:18:34 +02:00
|
|
|
'--flake[flake-uri]:PATH:_files -/' \
|
2021-06-06 00:11:06 +02:00
|
|
|
'--debug[debug]' \
|
2021-06-20 09:19:55 +02:00
|
|
|
'--impure[impure]' \
|
2021-01-02 14:07:14 +01:00
|
|
|
'--keep-failed[keep failed]' \
|
|
|
|
'--keep-going[keep going]' \
|
|
|
|
'--max-jobs[max jobs]:NUM:()' \
|
2021-07-26 14:58:26 +02:00
|
|
|
'--no-out-link[no out link]' \
|
2021-06-06 00:11:06 +02:00
|
|
|
'--no-substitute[no substitute]' \
|
2021-01-02 14:07:14 +01:00
|
|
|
'--option[option]:NAME VALUE:()' \
|
2021-06-06 00:11:06 +02:00
|
|
|
'--show-trace[show trace]' \
|
2021-08-17 22:53:44 +02:00
|
|
|
'--substitute[substitute]' \
|
2022-02-12 19:53:33 +01:00
|
|
|
'--builders[builders]:SPEC:()' \
|
2023-02-05 11:14:03 +01:00
|
|
|
'--refresh[refresh]' \
|
2022-02-12 19:53:33 +01:00
|
|
|
'--override-input[override flake input]:NAME VALUE:()' \
|
|
|
|
'--update-input[update flake input]:NAME:()' \
|
|
|
|
'--experimental-features[set experimental Nix features]:VALUE:()' \
|
|
|
|
'--extra-experimental-features:[append to experimental Nix features]:VALUE:()'
|
2021-01-02 14:07:14 +01:00
|
|
|
;;
|
2023-02-26 23:10:06 +01:00
|
|
|
init)
|
|
|
|
_arguments \
|
|
|
|
'--switch[switch]' \
|
|
|
|
':PATH:_files -/'
|
|
|
|
;;
|
2021-01-02 14:07:14 +01:00
|
|
|
esac
|
|
|
|
esac
|
|
|
|
|
|
|
|
return ret
|