From 752fce2538a1f82abe977e29354612dc0ca59341 Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Thu, 12 Sep 2024 13:55:15 +0100 Subject: [PATCH] qenya: zsh: automatically run nix-shell when necessary Closes #9 --- home/qenya/zsh.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/home/qenya/zsh.nix b/home/qenya/zsh.nix index f6ded78..42ccf8f 100644 --- a/home/qenya/zsh.nix +++ b/home/qenya/zsh.nix @@ -25,6 +25,15 @@ theme = "agnoster"; }; + initExtra = '' + # If a shell is started in a directory with a shell.nix, automatically run nix-shell + if [ -f ./shell.nix ]; then + if [ -z "$IN_NIX_SHELL" ]; then + nix-shell --command "zsh" + fi + fi + ''; + envExtra = '' DEFAULT_USER=qenya '';