From 1029f738b80f93a2154fd39028ee3ab539391ea7 Mon Sep 17 00:00:00 2001 From: jasmine Date: Mon, 29 Sep 2025 12:44:39 +0800 Subject: [PATCH 1/3] enhance wezterm: add intelligent development layout with Claude integration - Create 3-pane layout automatically: editor (main), terminal (bottom 30%), Claude sidebar (left 25%) - Implement smart focus management between editor and terminal panes - Add zoom toggling for distraction-free editing sessions - Launch Claude Code automatically in dedicated sidebar pane --- .../features/desktop/wezterm/wezterm.lua | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/home-manager/sajenim/features/desktop/wezterm/wezterm.lua b/home-manager/sajenim/features/desktop/wezterm/wezterm.lua index eed56a9..d1d321d 100644 --- a/home-manager/sajenim/features/desktop/wezterm/wezterm.lua +++ b/home-manager/sajenim/features/desktop/wezterm/wezterm.lua @@ -135,23 +135,36 @@ config.keys = { action = wezterm.action.SplitHorizontal({ domain = "CurrentPaneDomain" }), }, - { -- If there is only one pane, split it vertically, otherwise toggle zoom on the first pane. + { -- Dynamic pane management: Creates development layout or toggles focus between editor and terminal key = "`", mods = "LEADER", action = wezterm.action_callback(function(_, pane) local tab = pane:tab() local panes = tab:panes_with_info() + + -- Case 1: Single pane - Create a 3-pane development layout if #panes == 1 then + -- First split: Create bottom terminal pane (30% height) pane:split({ direction = "Bottom", - size = 0.3, + size = 0.30, }) - elseif not panes[1].is_zoomed then - panes[1].pane:activate() - tab:set_zoomed(true) - elseif panes[1].is_zoomed then - tab:set_zoomed(false) - panes[2].pane:activate() + -- Second split: Create left sidebar for Claude Code (25% width) + pane:split({ + direction = "Left", + size = 0.25, + args = { "claude" } -- Launch Claude Code in the sidebar + }) + + -- Case 2: Multiple panes exist, pane 2 (editor) is not zoomed - Focus and zoom editor + elseif not panes[2].is_zoomed then + panes[2].pane:activate() -- Switch to editor pane (typically Neovim) + tab:set_zoomed(true) -- Zoom to hide other panes for focused editing + + -- Case 3: Pane 2 (editor) is currently zoomed - Unzoom and return to terminal + elseif panes[2].is_zoomed then + tab:set_zoomed(false) -- Restore multi-pane layout + panes[3].pane:activate() -- Focus the terminal pane for quick commands end end), }, From 5b4944696e39c7a14578d328952b1654dfec58b1 Mon Sep 17 00:00:00 2001 From: jasmine Date: Mon, 29 Sep 2025 12:44:39 +0800 Subject: [PATCH 2/3] enhance wezterm: add intelligent development layout with Claude integration - Create 3-pane layout automatically: editor (main), terminal (bottom 30%), Claude sidebar (left 25%) - Implement smart focus management between editor and terminal panes - Add zoom toggling for distraction-free editing sessions - Launch Claude Code automatically in dedicated sidebar pane --- .../features/desktop/wezterm/wezterm.lua | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/home-manager/sajenim/features/desktop/wezterm/wezterm.lua b/home-manager/sajenim/features/desktop/wezterm/wezterm.lua index eed56a9..7d416a1 100644 --- a/home-manager/sajenim/features/desktop/wezterm/wezterm.lua +++ b/home-manager/sajenim/features/desktop/wezterm/wezterm.lua @@ -135,23 +135,31 @@ config.keys = { action = wezterm.action.SplitHorizontal({ domain = "CurrentPaneDomain" }), }, - { -- If there is only one pane, split it vertically, otherwise toggle zoom on the first pane. + { -- Dynamic pane management key = "`", mods = "LEADER", action = wezterm.action_callback(function(_, pane) local tab = pane:tab() local panes = tab:panes_with_info() + if #panes == 1 then pane:split({ direction = "Bottom", - size = 0.3, + size = 0.30, }) - elseif not panes[1].is_zoomed then - panes[1].pane:activate() - tab:set_zoomed(true) - elseif panes[1].is_zoomed then - tab:set_zoomed(false) + pane:split({ + direction = "Left", + size = 0.26, + args = { "claude" } + }) + + elseif not panes[2].is_zoomed then panes[2].pane:activate() + tab:set_zoomed(true) + + elseif panes[2].is_zoomed then + tab:set_zoomed(false) + panes[3].pane:activate() end end), }, From e5d1ba38d4bd677b274ca9125381b7e95f8aebb1 Mon Sep 17 00:00:00 2001 From: jasmine Date: Mon, 29 Sep 2025 18:30:59 +0800 Subject: [PATCH 3/3] remove ollama service from fuchsia host - Remove ollama service configuration and dependencies - Clean up traefik routing for ollama web interface - Comment out traefik service examples for clarity --- nixos/fuchsia/services/default.nix | 1 - nixos/fuchsia/services/ollama/default.nix | 50 -------------------- nixos/viridian/services/traefik/routers.nix | 8 ---- nixos/viridian/services/traefik/services.nix | 11 +++-- 4 files changed, 6 insertions(+), 64 deletions(-) delete mode 100644 nixos/fuchsia/services/ollama/default.nix diff --git a/nixos/fuchsia/services/default.nix b/nixos/fuchsia/services/default.nix index dfd7d8c..8924731 100644 --- a/nixos/fuchsia/services/default.nix +++ b/nixos/fuchsia/services/default.nix @@ -3,7 +3,6 @@ ./amdgpu-clocks ./flatpak ./libinput - ./ollama ./pipewire ./printing ./udev diff --git a/nixos/fuchsia/services/ollama/default.nix b/nixos/fuchsia/services/ollama/default.nix deleted file mode 100644 index d8f801b..0000000 --- a/nixos/fuchsia/services/ollama/default.nix +++ /dev/null @@ -1,50 +0,0 @@ -{...}: { - # Get up and running with large language models locally. - services.ollama = { - enable = true; - - # User and group under which to run ollama - user = "ollama"; - group = "ollama"; - - # AMD GPU Support - acceleration = "rocm"; - # 5700xt Support - rocmOverrideGfx = "10.1.0"; - - # Language models to install - loadModels = [ - "deepseek-r1:8b" - "gemma3:4b" - "qwen3:8b" - "llama3:8b" - - # Coding models - "qwen2.5-coder:7b" - ]; - - # Location to store models - models = "/srv/ollama/models"; - - # Increase context window - environmentVariables = { - OLLAMA_CONTEXT_LENGTH = "8192"; - }; - }; - - # Enable the Open-WebUI server - services.open-webui = { - enable = true; - host = "fuchsia.home.arpa"; - openFirewall = true; - }; - - # Mount our subvolume for storage of models - fileSystems = { - "/srv/ollama" = { - device = "/dev/disk/by-label/data"; - fsType = "btrfs"; - options = ["subvol=srv-ollama" "compress=zstd"]; - }; - }; -} diff --git a/nixos/viridian/services/traefik/routers.nix b/nixos/viridian/services/traefik/routers.nix index 57ad288..e3c382d 100644 --- a/nixos/viridian/services/traefik/routers.nix +++ b/nixos/viridian/services/traefik/routers.nix @@ -7,13 +7,5 @@ ]; service = "api@internal"; }; - - open-webui = { - rule = "Host(`ollama.home.arpa`)"; - entryPoints = [ - "websecure" - ]; - service = "open-webui"; - }; }; } diff --git a/nixos/viridian/services/traefik/services.nix b/nixos/viridian/services/traefik/services.nix index b858de3..ed57faa 100644 --- a/nixos/viridian/services/traefik/services.nix +++ b/nixos/viridian/services/traefik/services.nix @@ -1,7 +1,8 @@ {...}: { - services.traefik.dynamicConfigOptions.http.services = { - open-webui.loadBalancer.servers = [ - {url = "http://fuchsia.home.arpa:8080";} - ]; - }; + # # Example + # services.traefik.dynamicConfigOptions.http.services = { + # open-webui.loadBalancer.servers = [ + # {url = "http://fuchsia.home.arpa:8080";} + # ]; + # }; }