aboutsummaryrefslogtreecommitdiff
path: root/shellrc.d/nix
blob: e3357a6c68f79f5951639ee16c58e1e26da5235c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# vim: ft=sh:
if command -v nix >/dev/null; then

dev() {
	local target="$1"
	local flake dev
	IFS='#' read flake dev <<<"$target"
	if [ -z "$dev" ]; then
		dev="$flake"
		flake="personal"
		if [ -z "$dev" ]; then
			dev="default"
		fi
	fi
	nix develop "$flake#$dev" -c zsh
}

fi