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