From 610524402ca8edb6ed81c57cfcb6fa2db77e39a2 Mon Sep 17 00:00:00 2001 From: Raghuram Subramani Date: Mon, 20 May 2024 21:34:17 +0530 Subject: update --- config/bash.nix | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'config/bash.nix') diff --git a/config/bash.nix b/config/bash.nix index 563a60f..506c40a 100644 --- a/config/bash.nix +++ b/config/bash.nix @@ -15,17 +15,16 @@ if [ -n "$DIR" ] then - if [ "$1" == "-cd" ] - then - cd $DIR - return - fi - tmux new-session -d -c "$DIR" -s "$SESSION_NAME" - if [ -n "$TMUX" ] - then - tmux switch -t "$SESSION_NAME" + if [ -f "$DIR/flake.nix" ]; then + cd "$DIR" || exit + nix develop else - tmux attach -t "$SESSION_NAME" + tmux new-session -d -c "$DIR" -s "$SESSION_NAME" + if [ -n "$TMUX" ]; then + tmux switch -t "$SESSION_NAME" + else + tmux attach -t "$SESSION_NAME" + fi fi fi } -- cgit v1.2.3