core(flake/tmux): adding tmux env for me
- Using tmux for developpement propose so adding a cmd to addit (tmux-setup)
This commit is contained in:
parent
9424bcf213
commit
80f9c13203
1 changed files with 19 additions and 0 deletions
19
flake.nix
19
flake.nix
|
|
@ -19,6 +19,24 @@
|
||||||
flake-utils.lib.eachDefaultSystem (
|
flake-utils.lib.eachDefaultSystem (
|
||||||
system: let
|
system: let
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
tmux-setup = pkgs.writeShellScriptBin "tmux-setup" ''
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
SESSION="transandance"
|
||||||
|
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 split-window -v -p 30 -t $SESSION:0.1 -c "$DIR"
|
||||||
|
tmux send-keys -t $SESSION:0.2 'watch -n0.5 pnpm --prefix=./src/ eslint .' 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 {
|
||||||
devShell = pkgs.mkShellNoCC {
|
devShell = pkgs.mkShellNoCC {
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
|
|
@ -31,6 +49,7 @@
|
||||||
dbmlSQLite.packages.${system}.default
|
dbmlSQLite.packages.${system}.default
|
||||||
sqlite-interactive
|
sqlite-interactive
|
||||||
clang
|
clang
|
||||||
|
tmux-setup
|
||||||
];
|
];
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
export PODMAN_COMPOSE_WARNING_LOGS="false";
|
export PODMAN_COMPOSE_WARNING_LOGS="false";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue