1 { buildGoModule, fetchFromGitHub, lib }:
7 src = fetchFromGitHub {
11 sha256 = "sha256-Z5areIRlCyjUbusAdfL49mm5+J0UryWrS5/9Ttw16Po=";
12 # populate values that require us to use git. By doing this in postFetch we
13 # can delete .git afterwards and maintain better reproducibility of the src.
16 date -u -d "@$(git -C $out log -1 --pretty=%ct)" "+%Y-%m-%d %H:%M UTC" > $out/DATE
17 git -C $out rev-parse HEAD > $out/COMMIT
21 vendorHash = "sha256-JYZdV6CefCB7/WzeZqUhIsK3PKo9KJG15dinN3S+1xw=";
26 "-X github.com/mgechev/revive/cli.version=${version}"
27 "-X github.com/mgechev/revive/cli.builtBy=nix"
30 # ldflags based on metadata from git and source
32 ldflags+=" -X github.com/mgechev/revive/cli.commit=$(cat COMMIT)"
33 ldflags+=" -X 'github.com/mgechev/revive/cli.date=$(cat DATE)'"
36 # The following tests fail when built by nix:
38 # $ nix log /nix/store/build-revive.1.3.7.drv | grep FAIL
40 # --- FAIL: TestAll (0.01s)
41 # --- FAIL: TestTimeEqual (0.00s)
42 # --- FAIL: TestTimeNaming (0.00s)
43 # --- FAIL: TestUnhandledError (0.00s)
44 # --- FAIL: TestUnhandledErrorWithBlacklist (0.00s)
48 description = "Fast, configurable, extensible, flexible, and beautiful linter for Go";
49 mainProgram = "revive";
50 homepage = "https://revive.run";
51 license = licenses.mit;
52 maintainers = with maintainers; [ maaslalani ];