Add sshfs, tmuxKiller; Update

This commit is contained in:
Martin Pander
2026-06-19 07:09:36 +02:00
parent 4343c4b7ee
commit 1e0bc5d2b8
4 changed files with 49 additions and 13 deletions

24
flake.lock generated
View File

@@ -101,11 +101,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1780795403, "lastModified": 1781761792,
"narHash": "sha256-AkWx4Zt9pQbD/f82Z8N57+d0HGLN/rV3gdMKJTpBPKs=", "narHash": "sha256-rCPytmKNjctLloB6UgK5CRrHSwV4b0ygxtJLPPp8R14=",
"owner": "LnL7", "owner": "LnL7",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "6a771120d607dcccb279a27d227650e324815c35", "rev": "a1fa429e945becaf60468600daf649be4ba0350c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -159,11 +159,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1780749050, "lastModified": 1781577229,
"narHash": "sha256-3av0pIjlOWQ6rDbNOmpUSvbNnJkGORQKKjb4LtCZsIY=", "narHash": "sha256-lrp67w8AulE9Ks53n27I45ADSzbOCn4H+CNW1Ck8B+8=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a799d3e3886da994fa307f817a6bc705ae538eeb", "rev": "567a49d1913ce81ac6e9582e3553dd90a955875f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -206,11 +206,11 @@
}, },
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1780511130, "lastModified": 1781509190,
"narHash": "sha256-2v9lT4ya59Lh1FqPeLnz1MoX9y/wz2huqfe9RtQZITk=", "narHash": "sha256-uJZs9Di8I6ciTp6jiojj0HzlNpBkud8ax5aT/O5aJkw=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "535f3e6942cb1cead3929c604320d3db54b542b9", "rev": "d6df3513510aa548c83868fd22bfddd0a8c0a0d4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -222,11 +222,11 @@
}, },
"nixpkgs-wsl-stable": { "nixpkgs-wsl-stable": {
"locked": { "locked": {
"lastModified": 1780511130, "lastModified": 1781509190,
"narHash": "sha256-2v9lT4ya59Lh1FqPeLnz1MoX9y/wz2huqfe9RtQZITk=", "narHash": "sha256-uJZs9Di8I6ciTp6jiojj0HzlNpBkud8ax5aT/O5aJkw=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "535f3e6942cb1cead3929c604320d3db54b542b9", "rev": "d6df3513510aa548c83868fd22bfddd0a8c0a0d4",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -5,6 +5,9 @@
../../../modules/nixos/common.nix ../../../modules/nixos/common.nix
]; ];
# For sshfs
programs.fuse.userAllowOther = true;
wsl.enable = true; wsl.enable = true;
wsl.defaultUser = "pan"; wsl.defaultUser = "pan";
wsl.interop.register = true; wsl.interop.register = true;

View File

@@ -114,6 +114,7 @@ in
duf duf
lsof lsof
rclone rclone
sshfs
]; ];
home.sessionVariables = { home.sessionVariables = {

View File

@@ -72,6 +72,34 @@ let
fi fi
done done
''; '';
tmuxKiller = pkgs.writeScriptBin "tmuxKiller" ''
#!${pkgs.zsh}/bin/zsh
# 1. Build the list of active tmux sessions
sessions=$(${pkgs.tmux}/bin/tmux list-sessions -F "#S" 2>/dev/null)
if [[ -z "$sessions" ]]; then
echo "No active tmux sessions found."
exit 0
fi
# 2. Open fzf (Multi-select: Tab to mark multiple, Enter to confirm)
selected=$(echo "$sessions" | ${pkgs.fzf}/bin/fzf -m --header="Select tmux sessions to KILL (Tab to multi-select)" --reverse)
[[ -z "$selected" ]] && exit 0
# 3. Process selections
# Convert newline-separated string to array
selected_array=("''${(@f)selected}")
for s_name in "''${selected_array[@]}"; do
if ${pkgs.tmux}/bin/tmux has-session -t "$s_name" 2>/dev/null; then
${pkgs.tmux}/bin/tmux kill-session -t "$s_name"
echo "Killed session: $s_name"
fi
done
'';
in in
{ {
options.dot.tmux = { options.dot.tmux = {
@@ -110,6 +138,8 @@ in
bind C-g display-popup -E -d "#{pane_current_path}" -xC -yC -w 95% -h 95% "lazygit" bind C-g display-popup -E -d "#{pane_current_path}" -xC -yC -w 95% -h 95% "lazygit"
bind C-t display-popup -E -xC -yC -w 95% -h 95% "tasksquire" bind C-t display-popup -E -xC -yC -w 95% -h 95% "tasksquire"
bind C-r display-popup -E "tmuxKiller"
${lib.optionalString cfg.workMode '' ${lib.optionalString cfg.workMode ''
bind C-s display-popup -E "projectSelector" bind C-s display-popup -E "projectSelector"
bind C-n display-popup -E -xC -yC -w 95% -h 95% -d "/mnt/c/Users/marti/Documents/notes/Work/" "vim quick_notes.md" bind C-n display-popup -E -xC -yC -w 95% -h 95% -d "/mnt/c/Users/marti/Documents/notes/Work/" "vim quick_notes.md"
@@ -236,7 +266,9 @@ in
compdef _pro_completion pro compdef _pro_completion pro
''; '';
home.packages = lib.optional cfg.workMode projectSelector; home.packages = [
tmuxKiller
] ++ lib.optional cfg.workMode projectSelector;
home.shellAliases = { home.shellAliases = {
"o" = "tmuxp"; "o" = "tmuxp";