Commit 33841873b5e0

Vincent Demeester <vincent@sbr.pm>
2026-01-17 07:41:51
feat(kitty): add predefined sessions for development workflows
- Provide structured multi-pane layouts for common dev tasks - Simplify SSH integration by removing client-side shell hooks - Replace CWD tracking with explicit session configurations Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent bc72689
Changed files (3)
home
home/common/desktop/kitty.nix
@@ -107,6 +107,81 @@
       # The zsh function in programs.zsh.initExtra below handles this instead
       # by detecting "/" in the hostname and using raw ssh for those cases
     '';
+
+    # Session: NixOS development on aomi.sbr.pm
+    "kitty/sessions/nixos-dev.kitty-session".text = ''
+      # NixOS Development Session on aomi.sbr.pm
+      new_os_window
+      # Tab 1: Shpool development sessions (Claude + User)
+      # Tab 2: System monitoring (htop + journalctl)
+
+      # First tab - Development sessions with shpool
+      new_tab Development
+      layout splits
+      launch --title "Claude Session" ssh aomi.sbr.pm/claude/home=src/home
+      launch --title "User Session" --location=hsplit ssh aomi.sbr.pm/home=src/home
+
+      # Second tab - System monitoring
+      new_tab Monitoring
+      layout splits
+      launch --title "System Monitor" ssh -t aomi.sbr.pm htop
+      launch --title "Journal" --location=hsplit ssh -t aomi.sbr.pm journalctl -f
+
+      # Focus on development tab
+      focus_tab 1
+    '';
+
+    # Session: nixpkgs development
+    "kitty/sessions/nixpkgs-dev.kitty-session".text = ''
+      # Nixpkgs Development Session
+      # Development sessions with shpool (Claude + User)
+      new_os_window
+
+      # Development tab
+      new_tab Development
+      layout splits
+      launch --title "Claude Session" ssh aomi.sbr.pm/claude/nixpkgs=src/nixpkgs
+      launch --title "User Session" --location=hsplit ssh aomi.sbr.pm/nixpkgs=src/nixpkgs
+
+      # Focus on development tab
+      focus_tab 1
+    '';
+
+    # Session: Tekton Pipeline development with cluster monitoring
+    "kitty/sessions/tekton-pipeline-dev.kitty-session".text = ''
+      # Tekton Pipeline Development Session
+      # Tab 1: Development (cr + shell)
+      # Tab 2: Component logs (controller + webhook)
+      # Tab 3: Resource watches (PipelineRuns + TaskRuns)
+      #
+      # Uses direnv from ~/src/tektoncd/pipeline/.envrc for KUBECONFIG
+      # Create cluster with: kind create cluster --name tekton-dev --kubeconfig $KUBECONFIG
+      new_os_window
+
+      # First tab - Development (direnv auto-loads from .envrc)
+      new_tab Development
+      layout splits
+      cd ~/src/tektoncd/pipeline
+      launch --title "Claude Code" cr
+      launch --title "Shell" --location=hsplit
+
+      # Second tab - Component logs (using kail + snazy for better output)
+      new_tab Logs
+      layout splits
+      cd ~/src/tektoncd/pipeline
+      launch --title "Controller" bash -c 'eval "$(direnv export bash)"; while ! kubectl cluster-info &>/dev/null; do echo "⏳ Waiting for cluster..."; sleep 5; done; kail --ns=tekton-pipelines --label=app=tekton-pipelines-controller | snazy'
+      launch --title "Webhook" --location=hsplit bash -c 'eval "$(direnv export bash)"; while ! kubectl cluster-info &>/dev/null; do echo "⏳ Waiting for cluster..."; sleep 5; done; kail --ns=tekton-pipelines --label=app=tekton-pipelines-webhook | snazy'
+
+      # Third tab - Resource watches
+      new_tab Watches
+      layout splits
+      cd ~/src/tektoncd/pipeline
+      launch --title "PipelineRuns" bash -c 'eval "$(direnv export bash)"; while ! kubectl cluster-info &>/dev/null; do echo "⏳ Waiting for cluster..."; sleep 5; done; kubectl get pipelinerun -A -w'
+      launch --title "TaskRuns" --location=hsplit bash -c 'eval "$(direnv export bash)"; while ! kubectl cluster-info &>/dev/null; do echo "⏳ Waiting for cluster..."; sleep 5; done; kubectl get taskrun -A -w'
+
+      # Focus on development tab
+      focus_tab 1
+    '';
   };
 
   programs.zsh.initExtra = ''
home/common/shell/openssh.nix
@@ -50,8 +50,8 @@
                   else
                     id;
                 extraOptions = {
-                  # RemoteCommand = "shpool-ssh-wrapper $(echo '%k' | cut -d/ -f2-)";
-                  RemoteCommand = "bash -ic '[ -f ~/.local/share/kitty-ssh-kitten/zsh/kitty-integration ] && source ~/.local/share/kitty-ssh-kitten/zsh/kitty-integration 2>/dev/null; exec shpool-ssh-wrapper $(echo \"%k\" | cut -d/ -f2-)'";
+                  RemoteCommand = "shpool-ssh-wrapper $(echo '%k' | cut -d/ -f2-)";
+                  # RemoteCommand = "bash -ic '[ -f ~/.local/share/kitty-ssh-kitten/zsh/kitty-integration ] && source ~/.local/share/kitty-ssh-kitten/zsh/kitty-integration 2>/dev/null; exec shpool-ssh-wrapper $(echo \"%k\" | cut -d/ -f2-)'";
                   RequestTTY = "yes";
                 };
               };
home/common/shell/zsh.nix
@@ -1,10 +1,4 @@
-{
-  config,
-  lib,
-  pkgs,
-  desktop ? null,
-  ...
-}:
+{ config, pkgs, ... }:
 {
   home.file."${config.programs.zsh.dotDir}/completion.zsh".source = ./zsh/completion.zsh;
   home.file."${config.programs.zsh.dotDir}/prompt.zsh".source = ./zsh/prompt.zsh;
@@ -12,19 +6,6 @@
   home.file."${config.programs.zsh.dotDir}/auto-expanding-aliases.zsh".source =
     ./zsh/auto-expanding-aliases.zsh;
 
-  # Kitty shell integration for CWD tracking in shpool sessions
-  # Only deploy on headless servers (not on desktops/laptops)
-  home.file.".local/share/kitty-ssh-kitten/shell-integration/zsh/kitty-integration" =
-    lib.mkIf (desktop == null)
-      {
-        source = "${pkgs.kitty}/lib/kitty/shell-integration/zsh/kitty-integration";
-      };
-  home.file.".local/share/kitty-ssh-kitten/shell-integration/zsh/kitty.zsh" =
-    lib.mkIf (desktop == null)
-      {
-        source = "${pkgs.kitty}/lib/kitty/shell-integration/zsh/kitty.zsh";
-      };
-
   home.packages = with pkgs; [
     nix-zsh-completions
   ];
@@ -126,13 +107,6 @@
       			# 	exec dbus-run-session niri-session
             # fi
     '';
-    initExtra = ''
-      # Kitty shell integration (enables CWD tracking in shpool sessions)
-      # This allows new_window_with_cwd to work when using ssh host/session pattern
-      if [[ -f ~/.local/share/kitty-ssh-kitten/shell-integration/zsh/kitty-integration ]]; then
-        source ~/.local/share/kitty-ssh-kitten/shell-integration/zsh/kitty-integration
-      fi
-    '';
     sessionVariables = {
       RPROMPT = "";
     };