about summary refs log blame commit diff
path: root/tools/gerrit-cli.nix
blob: 1606155a8068dd1dad27457ce2e2302a4e4532c2 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11





                                                                   
                                



                                 
                                                            
  
# 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 &>/dev/null; then
    ssh=ssh
  else
    ssh="${pkgs.openssh}/bin/ssh"
  fi
  exec $ssh $TVL_USERNAME@code.tvl.fyi -p 29418 -- gerrit $@
''