aboutsummaryrefslogtreecommitdiff
path: root/pkgs/dev
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2022-11-15 15:07:34 +0100
committerKarel Kočí <cynerd@email.cz>2022-11-15 16:30:16 +0100
commitfbc988088c25ab6a81e786a9554cb03e8ead4958 (patch)
treec5db2823b4c21118da8987157935ae0068af16f1 /pkgs/dev
parent0d5e13b2606ec4c99872dfe3b5cc949c9dea41e1 (diff)
downloadnixos-personal-fbc988088c25ab6a81e786a9554cb03e8ead4958.tar.gz
nixos-personal-fbc988088c25ab6a81e786a9554cb03e8ead4958.tar.bz2
nixos-personal-fbc988088c25ab6a81e786a9554cb03e8ead4958.zip
pkgs/dev: allow running without argument
Diffstat (limited to 'pkgs/dev')
-rwxr-xr-xpkgs/dev/dev.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/pkgs/dev/dev.sh b/pkgs/dev/dev.sh
index 2d71c41..924b39b 100755
--- a/pkgs/dev/dev.sh
+++ b/pkgs/dev/dev.sh
@@ -1,15 +1,18 @@
#!/usr/bin/env bash
set -eu
-target="$1"
+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: we do not need substituters as this should be build
+ nixargs+=("--no-substitute")
break
fi
done <<<"$known_shells"
-exec nix develop "$target" -c zsh "$@"
+exec nix "${nixargs[@]}" develop "$target" -c zsh "$@"