aboutsummaryrefslogtreecommitdiff
path: root/pkgs/dev/dev.sh
blob: 924b39b09014d423b8e1fdbf8df23c19a2638ac9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env bash
set -eu

target="${1:-}"
shift

declare -a nixargs
known_shells="$(tr ':' '\n' <<<"${DEV_SHELLS:-}")"
while IFS='=' read name drv res; do
	if [ "$target" == "$name" ]; then
		target="$drv"
		# Note: we do not need substituters as this should be build
		nixargs+=("--no-substitute")
		break
	fi
done <<<"$known_shells"

exec nix "${nixargs[@]}" develop "$target" -c zsh "$@"