blob: 1c07d3a6a45a47bf7b47fd8c5c58e4c62c128718 (
plain)
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
|
# Wrappers for nix-shell and nix develop that auto-start $SHELL
nix-shell() {
for arg in "$@"; do
if [[ "$arg" == "--run" || "$arg" == "--command" ]]; then
command nix-shell "$@"
return
fi
done
command nix-shell "$@" --run "$SHELL"
}
nix() {
if [[ "$1" == "develop" ]]; then
local args=("${@:2}")
for arg in "${args[@]}"; do
if [[ "$arg" == "-c" || "$arg" == "--command" ]]; then
command nix "$@"
return
fi
done
command nix develop "${args[@]}" -c "$SHELL"
else
command nix "$@"
fi
}
|