about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-05-29 10:28:18 -0700
committerFranck Cuny <franck@fcuny.net>2022-05-29 10:40:46 -0700
commit86401b65a7466b24d0fbc69ca28892014d4b91c5 (patch)
treef486d0ed8fddccf92d23bb4a41e4044cc8f7d335
parentref(tahoe): remove drone (diff)
downloadworld-86401b65a7466b24d0fbc69ca28892014d4b91c5.tar.gz
feat(home/zsh): add helper function for gerrit
Add a function `rgerrit' to run gerrit commands on the server.

Change-Id: I2beb77e7817e2be03ffbd008cf3545091a9d4c41
Reviewed-on: https://cl.fcuny.net/c/world/+/163
Reviewed-by: Franck Cuny <franck@fcuny.net>
-rw-r--r--home/zsh/default.nix2
-rw-r--r--home/zsh/gerrit.zsh5
2 files changed, 6 insertions, 1 deletions
diff --git a/home/zsh/default.nix b/home/zsh/default.nix
index 0ee9e43..fad7b2e 100644
--- a/home/zsh/default.nix
+++ b/home/zsh/default.nix
@@ -34,7 +34,6 @@ in {
       shellAliases = {
         ll = "ls -l --color=auto";
         lt = "ls -ltrh --color=auto";
-        drone = "DRONE_TOKEN=$(pass api/drone.fcuny.xyz) drone";
       };
 
       defaultKeymap = "emacs";
@@ -47,6 +46,7 @@ in {
 
       initExtra = lib.concatMapStrings builtins.readFile [
         ./completion-style.zsh
+        ./gerrit.zsh
         ./options.zsh
         ./prompt.zsh
         ./tmux.zsh
diff --git a/home/zsh/gerrit.zsh b/home/zsh/gerrit.zsh
new file mode 100644
index 0000000..9766b2f
--- /dev/null
+++ b/home/zsh/gerrit.zsh
@@ -0,0 +1,5 @@
+function rgerrit() {
+  # gerrit runs on tahoe, and we ssh to it through its tailscale
+  # network interface.
+  ssh $(tailscale status --json | jq -r '.Peer | map(select(.HostName == "tahoe"))[0].TailscaleIPs[0]') -p 29418 gerrit $@
+}