blob: 0bcfbe5c5f18018ca0431f3826e82d40ac913c01 (
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
|
# Nix aliases - 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
}
|