about summary refs log tree commit diff
path: root/tools/gerrit-cli.nix
blob: 05c54da331f43d6b0abfd86cadb221e2cf894df8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
# Utility script to run a gerrit command on the depot host via ssh.
# Reads the username from TVL_USERNAME, or defaults to $(whoami)
{ pkgs, ... }:

pkgs.writeShellScriptBin "gerrit" ''
  TVL_USERNAME=''${TVL_USERNAME:-$(whoami)}
  if which ssh 2>/dev/null; then
    ssh=ssh
  else
    ssh="${pkgs.openssh}/bin/ssh"
  fi
  $ssh $TVL_USERNAME@code.tvl.fyi -p 29418 -- gerrit $@
''