@@ -0,0 +1,40 @@
1+{ stdenv, buildGoModule, fetchFromGitHub }:
2+
3+buildGoModule rec {
4+ pname = "dstask";
5+ version = "0.18";
6+
7+ src = fetchFromGitHub {
8+ owner = "naggie";
9+ repo = pname;
10+ rev = "v${version}";
11+ sha256 = "16z5zlfj955pzsj0l58835slvpchdaq2vbyx2fjzi6y9xn1z2nd1";
12+ };
13+
14+ # Set vendorSha256 to null because dstask vendors its dependencies (meaning
15+ # that third party dependencies are stored in the repository).
16+ #
17+ # Ref <https://github.com/NixOS/nixpkgs/pull/87383#issuecomment-633204382>
18+ # and <https://github.com/NixOS/nixpkgs/blob/d4226e3a4b5fcf988027147164e86665d382bbfa/pkgs/development/go-modules/generic/default.nix#L18>
19+ vendorSha256 = null;
20+
21+ # The ldflags reduce the executable size by stripping some debug stuff.
22+ # The other variables are set so that the output of dstask version shows the
23+ # git ref and the release version from github.
24+ # Ref <https://github.com/NixOS/nixpkgs/pull/87383#discussion_r432097657>
25+ buildFlagsArray = [ ''
26+ -ldflags=-w -s
27+ -X "github.com/naggie/dstask.VERSION=${version}"
28+ -X "github.com/naggie/dstask.GIT_COMMIT=v${version}"
29+ '' ];
30+
31+ subPackages = [ "cmd/dstask.go" ];
32+
33+ meta = with stdenv.lib; {
34+ description = "Command line todo list with super-reliable git sync";
35+ homepage = src.meta.homepage;
36+ license = licenses.mit;
37+ maintainers = with maintainers; [ stianlagstad foxit64 ];
38+ platforms = platforms.linux;
39+ };
40+}