aboutsummaryrefslogtreecommitdiff
path: root/pkgs/dev/dev.sh
blob: adf70f8db48539fcf070ca9f7a16468e2c2d0b64 (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: no network should be needed as this should be available
		nixargs+=("--offline")
		break
	fi
done <<<"$known_shells"

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