From 71dbd4b1534e2792d1cb384e87a6ba9d6d04a6ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Wed, 10 Aug 2022 10:28:46 +0200 Subject: shellrc.d/nix: add devzsh --- shellrc.d/nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 shellrc.d/nix (limited to 'shellrc.d/nix') 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 -- cgit v1.2.3