From 47692795b39aa4463487be3202f62ae900797d24 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Mon, 20 Jun 2022 13:45:50 -0700 Subject: feat(home/shell): manage fish's functions directory Change-Id: I03a35a211c7563e65770b39b140099291efafab9 Reviewed-on: https://cl.fcuny.net/c/world/+/458 Reviewed-by: Franck Cuny Tested-by: CI --- home/shell/fish/default.nix | 4 ++++ home/shell/fish/functions/nix-rebuild-host.fish | 4 ++++ home/shell/fish/functions/rgerrit.fish | 6 ++++++ 3 files changed, 14 insertions(+) create mode 100644 home/shell/fish/functions/nix-rebuild-host.fish create mode 100644 home/shell/fish/functions/rgerrit.fish (limited to 'home') diff --git a/home/shell/fish/default.nix b/home/shell/fish/default.nix index c81f188..d000cd9 100644 --- a/home/shell/fish/default.nix +++ b/home/shell/fish/default.nix @@ -27,5 +27,9 @@ in end ''; }; + xdg.configFile."fish/functions" = { + source = ./functions; + recursive = true; + }; }; } 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 -- cgit 1.4.1