-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy path_nix-shell
36 lines (32 loc) · 1.07 KB
/
_nix-shell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#compdef nix-shell
#autoload
_nix-common-options
local -a _nix_shell_opts=(
'--command[Run a command instead of starting an interactive shell]:Command:_command_names'
'--exclude[Do not build any dependencies which match this regex]:Regex:( )'
'--pure[Clear the environment before starting the interactive shell]'
'--run[Run a command in a non-interactive shell instead of starting an interactive shell]:Command:_command_names'
'*'{--attr,-A}"[setup a build shell for package]:package:_nix_complete_attr_paths"
)
local norm_arguments='*:Paths:_nix_path'
local word
for word in $words; do
case "$word" in
--packages|-[^-]#p[^-]#)
norm_arguments='*:Packages: _nix_attr_paths "import <nixpkgs>"'
break
;;
--expr|-[^-]#E[^-]#)
norm_arguments='*:Expression:'
;;
esac
done
_arguments \
$__nix_boilerplate_opts \
$__nix_common_opts \
$__nix_dry_run \
$_nix_shell_opts \
$norm_arguments \
- '(group)' \
$__nix_expr_opts \
{--packages,-p}'[run with packages from <nixpkgs> (override usinge -I)]'