summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/bash.nix19
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
}