aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2022-08-10 10:28:46 +0200
committerKarel Kočí <cynerd@email.cz>2022-08-10 10:28:46 +0200
commit71dbd4b1534e2792d1cb384e87a6ba9d6d04a6ff (patch)
tree01b9d43d285192f0b667e9d235c81070466a372e
parenta72880521555bff5a15f55bdd08fca9f3c414e9f (diff)
downloadshellrc-71dbd4b1534e2792d1cb384e87a6ba9d6d04a6ff.tar.gz
shellrc-71dbd4b1534e2792d1cb384e87a6ba9d6d04a6ff.tar.bz2
shellrc-71dbd4b1534e2792d1cb384e87a6ba9d6d04a6ff.zip
shellrc.d/nix: add devzsh
-rw-r--r--flake.nix2
-rwxr-xr-xinstall1
-rw-r--r--shellrc.d/nix18
3 files changed, 19 insertions, 2 deletions
diff --git a/flake.nix b/flake.nix
index 83e73b6..754df60 100644
--- a/flake.nix
+++ b/flake.nix
@@ -15,7 +15,7 @@
zshrc = loadrc ./zshrc.d;
packages = pkgs: rec {
- shellrc-completion = pkgs.stdenv.mkDerivation rec {
+ shellrc-completion = pkgs.stdenv.mkDerivation {
name = "shellrc-completion";
src = ./.;
nativeBuildInputs = [ pkgs.installShellFiles ];
diff --git a/install b/install
index f54b249..e5e12a2 100755
--- a/install
+++ b/install
@@ -92,4 +92,3 @@ if $U_ZSH; then
mkdir -p "$I_PREFIX/usr/share/zsh/site-functions"
cp -r zsh-completion/. "$I_PREFIX/usr/share/zsh/site-functions"
fi
-
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