diff options
| author | Raghuram Subramani <raghus2247@gmail.com> | 2024-05-20 21:34:17 +0530 |
|---|---|---|
| committer | Raghuram Subramani <raghus2247@gmail.com> | 2024-05-20 21:34:26 +0530 |
| commit | 610524402ca8edb6ed81c57cfcb6fa2db77e39a2 (patch) | |
| tree | 1dc2e9dfa4a7c3b8b84eb88a078cfdd262f416a9 /config/bash.nix | |
| parent | 18d5951265c67bcf99237f9543f89793bd024d55 (diff) | |
update
Diffstat (limited to '')
| -rw-r--r-- | config/bash.nix | 19 |
1 files changed, 9 insertions, 10 deletions
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 } |
