build(nix/flake): adding the tmux-setup script

Script to setup tmux automaticly
This commit is contained in:
Raphael 2025-11-29 14:58:01 +01:00
parent 7ad6ac2854
commit e96363e623
No known key found for this signature in database

View file

@ -16,6 +16,22 @@
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
}; };
tmux-setup = pkgs.writeShellScriptBin "tmux-setup" ''
#!/usr/bin/env sh
SESSION="transcendance"
DIR=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
if ! tmux has-session -t $SESSION 2>/dev/null; then
tmux new-session -d -s $SESSION -c "$DIR" -n dev
tmux send-keys -t $SESSION:0 'vim' C-m
tmux split-window -h -p 30 -t $SESSION:0 -c "$DIR"
tmux send-keys -t $SESSION:0.1 'exec zsh' C-m
tmux new-window -t $SESSION:1 -n git -c "$DIR"
tmux send-keys -t $SESSION:1 'lazygit' C-m
fi
tmux select-window -t $SESSION:0
tmux select-pane -t $SESSION:0.0
tmux attach -t $SESSION
'';
in in
{ {
devShells.default = pkgs.mkShell { devShells.default = pkgs.mkShell {
@ -23,6 +39,7 @@
buildInputs = buildInputs =
with pkgs; with pkgs;
[ [
tmux-setup
nasm nasm
gcc gcc
binutils binutils