aboutsummaryrefslogtreecommitdiff
path: root/shellrc.d/nix
diff options
context:
space:
mode:
Diffstat (limited to 'shellrc.d/nix')
-rw-r--r--shellrc.d/nix18
1 files changed, 18 insertions, 0 deletions
diff --git a/shellrc.d/nix b/shellrc.d/nix
new file mode 100644
index 0000000..ee207c9
--- /dev/null
+++ b/shellrc.d/nix
@@ -0,0 +1,18 @@
+# vim: ft=sh:
+if command -v nix >/dev/null; then
+
+devzsh() {
+ 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