1 { lib, fetchFromGitHub, buildGoModule }:
3 let config-module = "git-get/pkg/cfg";
9 src = fetchFromGitHub {
13 hash = "sha256-v98Ff7io7j1LLzciHNWJBU3LcdSr+lhwYrvON7QjyCI=";
14 # populate values that require us to use git. By doing this in postFetch we
15 # can delete .git afterwards and maintain better reproducibility of the src.
18 git -C $out rev-parse HEAD > $out/COMMIT
19 # in format of 0000-00-00T00:00:00Z
20 date -u -d "@$(git -C $out log -1 --pretty=%ct)" "+%Y-%m-%dT%H:%M:%SZ" > $out/SOURCE_DATE_EPOCH
21 find "$out" -name .git -print0 | xargs -0 rm -rf
25 vendorHash = "sha256-C+XOjMDMFneKJNeBh0KWPx8yM7XiiIpTlc2daSfhZhY=";
29 # ldflags based on metadata from git and source
31 ldflags+=" -X ${config-module}.commit=$(cat COMMIT)"
32 ldflags+=" -X ${config-module}.date=$(cat SOURCE_DATE_EPOCH)"
38 "-X ${config-module}.version=v${version}"
42 mv "$GOPATH/bin/get" "$GOPATH/bin/git-get"
43 mv "$GOPATH/bin/list" "$GOPATH/bin/git-list"
47 description = "Better way to clone, organize and manage multiple git repositories";
48 homepage = "https://github.com/grdl/git-get";
49 license = licenses.mit;
50 maintainers = with maintainers; [ sumnerevans ];