build(nix/flake): adding the tmux-setup script
Script to setup tmux automaticly
This commit is contained in:
parent
7ad6ac2854
commit
e96363e623
1 changed files with 17 additions and 0 deletions
17
flake.nix
17
flake.nix
|
|
@ -16,6 +16,22 @@
|
|||
pkgs = import nixpkgs {
|
||||
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
|
||||
{
|
||||
devShells.default = pkgs.mkShell {
|
||||
|
|
@ -23,6 +39,7 @@
|
|||
buildInputs =
|
||||
with pkgs;
|
||||
[
|
||||
tmux-setup
|
||||
nasm
|
||||
gcc
|
||||
binutils
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue