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

target="${1:-.}"
[[ $# -eq 0 ]] || shift

declare -a nixargs
while IFS='=' read -r name drv _; do
	if [ "$target" == "$name" ]; then
		target="$drv^*"
		# Note: no network should be needed as this should be available
		nixargs+=("--offline")
		break
	fi
done < <(tr ':' '\n' <<<"${DEV_SHELLS:-}")

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