about summary refs log tree commit diff
path: root/home/shell/fish/functions
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-06-20 13:45:50 -0700
committerFranck Cuny <franck@fcuny.net>2022-06-20 14:41:06 -0700
commit47692795b39aa4463487be3202f62ae900797d24 (patch)
treed36b0adaf6440526e0b7edff5a36a13ea3c3ff96 /home/shell/fish/functions
parentref(home/shell): switch default shell to fish (diff)
downloadworld-47692795b39aa4463487be3202f62ae900797d24.tar.gz
feat(home/shell): manage fish's functions directory
Change-Id: I03a35a211c7563e65770b39b140099291efafab9
Reviewed-on: https://cl.fcuny.net/c/world/+/458
Reviewed-by: Franck Cuny <franck@fcuny.net>
Tested-by: CI
Diffstat (limited to 'home/shell/fish/functions')
-rw-r--r--home/shell/fish/functions/nix-rebuild-host.fish4
-rw-r--r--home/shell/fish/functions/rgerrit.fish6
2 files changed, 10 insertions, 0 deletions
diff --git a/home/shell/fish/functions/nix-rebuild-host.fish b/home/shell/fish/functions/nix-rebuild-host.fish
new file mode 100644
index 0000000..1ec7daa
--- /dev/null
+++ b/home/shell/fish/functions/nix-rebuild-host.fish
@@ -0,0 +1,4 @@
+function nix-rebuild-host --description "rebuild the current host"
+  cd ~/workspace/world
+  sudo nixos-rebuild switch --flake .
+end
diff --git a/home/shell/fish/functions/rgerrit.fish b/home/shell/fish/functions/rgerrit.fish
new file mode 100644
index 0000000..3aed310
--- /dev/null
+++ b/home/shell/fish/functions/rgerrit.fish
@@ -0,0 +1,6 @@
+# gerrit runs on tahoe, and we ssh to it through its tailscale
+# network interface.
+function rgerrit --description "execute gerrit commands"
+  set -lx gerrit_host (tailscale status --json | jq -r '.Peer | map(select(.HostName == "tahoe"))[0].TailscaleIPs[0]')
+  ssh $gerrit_host -p 29418 gerrit $argv
+end