aboutsummaryrefslogtreecommitdiff
path: root/pkgs/dev/dev.sh
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2024-05-06 12:38:59 +0200
committerKarel Kočí <cynerd@email.cz>2024-05-06 12:38:59 +0200
commit90947cf469bb15dbcee18fc7c6274420d7cf3c42 (patch)
tree0edad35b1ae706d883f6305e8582e1622c324d3a /pkgs/dev/dev.sh
parentbbda84ca261397086f866ece115c4ec9111d4d02 (diff)
downloadnixos-personal-90947cf469bb15dbcee18fc7c6274420d7cf3c42.tar.gz
nixos-personal-90947cf469bb15dbcee18fc7c6274420d7cf3c42.tar.bz2
nixos-personal-90947cf469bb15dbcee18fc7c6274420d7cf3c42.zip
pkgs/dev: Fix usage with new version of nix
Diffstat (limited to 'pkgs/dev/dev.sh')
-rwxr-xr-xpkgs/dev/dev.sh11
1 files changed, 5 insertions, 6 deletions
diff --git a/pkgs/dev/dev.sh b/pkgs/dev/dev.sh
index adf70f8..8546b85 100755
--- a/pkgs/dev/dev.sh
+++ b/pkgs/dev/dev.sh
@@ -1,18 +1,17 @@
#!/usr/bin/env bash
set -eu
-target="${1:-}"
-shift
+target="${1:-.}"
+[[ $# -eq 0 ]] || shift
declare -a nixargs
-known_shells="$(tr ':' '\n' <<<"${DEV_SHELLS:-}")"
-while IFS='=' read name drv res; do
+while IFS='=' read -r name drv _; do
if [ "$target" == "$name" ]; then
- target="$drv"
+ target="$drv^*"
# Note: no network should be needed as this should be available
nixargs+=("--offline")
break
fi
-done <<<"$known_shells"
+done < <(tr ':' '\n' <<<"${DEV_SHELLS:-}")
exec nix "${nixargs[@]}" develop "$target" -c zsh "$@"