From 86401b65a7466b24d0fbc69ca28892014d4b91c5 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sun, 29 May 2022 10:28:18 -0700 Subject: 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 --- home/zsh/default.nix | 2 +- home/zsh/gerrit.zsh | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 home/zsh/gerrit.zsh (limited to 'home/zsh') 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 $@ +} -- cgit 1.4.1