# vim: ft=sh:
if command -v nix >/dev/null; then
dev() {
local target="$1"
local flake dev
if [[ "${target#*"#"}" != "$target" ]]; then
IFS='#' read flake dev <<<"$target"
else
if [ -e "$target" ]; then
flake="$target"
dev="default"
else
flake="personal"
dev="${target:-default}"
fi
fi
nix develop "$flake#$dev" -c zsh
}
fi