Skip to content

Instantly share code, notes, and snippets.

@dustinlacewell-wk
Created November 9, 2017 21:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dustinlacewell-wk/ea52ab6275d9fb604f8ae98754f2baed to your computer and use it in GitHub Desktop.
Save dustinlacewell-wk/ea52ab6275d9fb604f8ae98754f2baed to your computer and use it in GitHub Desktop.
with import <nixpkgs> {};
let
url_auth = "$WORKIVA_PRIVATE_GITHUB_TOKEN:x-oauth-basic";
url_new = "https://${url_auth}@github.com/";
url_old = "https://github.com/";
in stdenv.mkDerivation rec {
name = "harbour-cli";
src = ./.;
buildInputs = [ git go glide ];
impureEnvVars = [ "WORKIVA_PRIVATE_GITHUB_TOKEN" ];
phases = [ "buildPhase" ];
buildPhase = ''
HOME="$PWD" # so git can find .gitconfig
GOPATH="$PWD:$GOPATH"
git config --global url."${url_new}".insteadOf "${url_old}";
cp -r $src/* .
glide install
mv vendor src
go test --cover
go build -o $out/harbour-cli
'';
shellHook = ''
source $HOME/.secrets
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment