From 318c64a371debfb2850dfac6ae708c785951f31b Mon Sep 17 00:00:00 2001 From: Emma Thorpe Date: Wed, 10 Jun 2026 16:43:43 +0100 Subject: [PATCH] feat(home): work k8s/TF CLIs, shell + git polish, themed btop, lazygit - work.nix: k9s, kubectx/kubens, stern, dyff, tflint, terraform-docs, yq-go for the EDaaS Kubernetes/Terraform workflow. - shell.nix: btop themed Catppuccin Mocha (vendored theme; not bundled), hyperfine + sd, and the tmux extrakto plugin (prefix+Tab grab). - git.nix: amend/fixup/undo aliases, commit-graph maintenance, and lazygit (themed). Corrected the stale work/default.nix doc references. Co-Authored-By: Claude Opus 4.8 (1M context) --- lyrathorpe/home/git.nix | 26 ++++++++++++++++++++++++-- lyrathorpe/home/shell.nix | 17 +++++++++++++++-- lyrathorpe/home/work.nix | 8 ++++++++ 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a/lyrathorpe/home/git.nix b/lyrathorpe/home/git.nix index d539e6a..ae11c7f 100644 --- a/lyrathorpe/home/git.nix +++ b/lyrathorpe/home/git.nix @@ -1,11 +1,14 @@ -# Version control: git + delta pager + commitizen. The work host layers -# commit signing and an email override on top (see work/default.nix). +# Version control: git + delta pager + commitizen + lazygit. The work host +# layers commit signing and an email override on top (see work.nix). { pkgs, lib, fullName, ... }: +let + ctp = import ../catppuccin-mocha.nix; +in { home.packages = [ pkgs.commitizen @@ -31,6 +34,9 @@ }; fetch.prune = true; # drop deleted remote-tracking branches + # Keep the commit-graph current (fast `git log --graph`, used by `lg`). + fetch.writeCommitGraph = true; + gc.writeCommitGraph = true; merge.conflictStyle = "zdiff3"; # show the common ancestor in conflicts diff = { algorithm = "histogram"; @@ -61,6 +67,9 @@ ci = "commit"; last = "log -1 HEAD"; unstage = "reset HEAD --"; + amend = "commit --amend --no-edit"; # tack staged changes onto HEAD + fixup = "commit --fixup"; # `git fixup ` -> autosquash on next rebase + undo = "reset --soft HEAD~1"; # undo last commit, keep the changes staged lg = "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)' --all"; # commitizen (Conventional Commits, its default ruleset): `git cz c` -> # `cz commit`, `git cz bump`, etc. `git cc` is a shortcut for the prompt. @@ -92,4 +101,17 @@ enable = true; enableGitIntegration = true; }; + + # lazygit: TUI for staging/rebasing, themed to Catppuccin Mocha to match. + programs.lazygit = { + enable = true; + settings.gui.theme = { + activeBorderColor = [ + "#${ctp.blue}" + "bold" + ]; + inactiveBorderColor = [ "#${ctp.surface1}" ]; + selectedLineBgColor = [ "#${ctp.surface0}" ]; + }; + }; } diff --git a/lyrathorpe/home/shell.nix b/lyrathorpe/home/shell.nix index a16d455..72a66f5 100644 --- a/lyrathorpe/home/shell.nix +++ b/lyrathorpe/home/shell.nix @@ -23,10 +23,22 @@ in pkgs.ripgrep pkgs.fd pkgs.jq - pkgs.btop pkgs.tea + pkgs.hyperfine # command-line benchmarking + pkgs.sd # saner find-and-replace than sed ]; + # Resource monitor, themed Catppuccin Mocha to match the rest of the desktop. + # btop does not bundle the theme, so vendor it from catppuccin/btop (pinned). + programs.btop = { + enable = true; + settings.color_theme = "catppuccin_mocha"; + }; + xdg.configFile."btop/themes/catppuccin_mocha.theme".source = pkgs.fetchurl { + url = "https://raw.githubusercontent.com/catppuccin/btop/f437574b600f1c6d932627050b15ff5153b58fa3/themes/catppuccin_mocha.theme"; + hash = "sha256-THRpq5vaKCwf9gaso3ycC4TNDLZtBB5Ofh/tOXkfRkQ="; + }; + programs.zsh = { enable = true; # Keep zsh dotfiles under XDG (~/.config/zsh) rather than the legacy $HOME @@ -218,6 +230,7 @@ in sensible vim-tmux-navigator # Ctrl-h/j/k/l across vim splits and tmux panes yank + extrakto # prefix+Tab: fzf-grab paths/URLs/text from the pane into the prompt { # Catppuccin Mocha statusline (v2 API: flavour + window options must be # set before the plugin loads, which home-manager does for plugin @@ -283,7 +296,7 @@ in # Add the key to the agent on first use, so the passphrase is typed once per # login session rather than per commit/push (commit signing uses this agent). - # The work box keeps its own ssh config (see work/default.nix), so this only + # The work box keeps its own ssh config (see work.nix), so this only # manages ~/.ssh/config on the personal hosts. programs.ssh = { enable = true; diff --git a/lyrathorpe/home/work.nix b/lyrathorpe/home/work.nix index 27d54ea..d504026 100644 --- a/lyrathorpe/home/work.nix +++ b/lyrathorpe/home/work.nix @@ -39,6 +39,14 @@ pkgs.wget pkgs.claude-code pkgs.google-cloud-sdk + # Day-to-day Kubernetes / Helm / Terraform accelerators for this box. + pkgs.k9s # cluster TUI + pkgs.kubectx # kubectx + kubens (context/namespace switch) + pkgs.stern # multi-pod log tail + pkgs.dyff # semantic YAML/manifest diffs (Helm release drift) + pkgs.tflint # Terraform linter (catches what terraformls won't) + pkgs.terraform-docs # generate Terraform module docs + pkgs.yq-go # jq for YAML ]; services.ssh-agent.enable = true; home.shellAliases = {