about summary refs log tree commit diff
diff options
context:
space:
mode:
authorStian Lågstad <stianlagstad@gmail.com>2020-05-29 08:03:28 +0200
committerStian Lågstad <stianlagstad@gmail.com>2020-05-30 11:56:21 +0200
commit036eb89f1658ec43461f22230dd760fc928a1085 (patch)
tree9cc83ad8dd88970edf2f174d7184616538709fe2
parentd1a6f2ed022d41026f5b1d2d1afb79222889c9cd (diff)
downloadnixlib-036eb89f1658ec43461f22230dd760fc928a1085.tar
nixlib-036eb89f1658ec43461f22230dd760fc928a1085.tar.gz
nixlib-036eb89f1658ec43461f22230dd760fc928a1085.tar.bz2
nixlib-036eb89f1658ec43461f22230dd760fc928a1085.tar.lz
nixlib-036eb89f1658ec43461f22230dd760fc928a1085.tar.xz
nixlib-036eb89f1658ec43461f22230dd760fc928a1085.tar.zst
nixlib-036eb89f1658ec43461f22230dd760fc928a1085.zip
dstask: init at 0.18
Thank you to: foxit64, naggie, timokau, Lassulus, 06kellyjac,
symphorien, wamserma.
-rw-r--r--pkgs/applications/misc/dstask/default.nix40
-rw-r--r--pkgs/top-level/all-packages.nix2
2 files changed, 42 insertions, 0 deletions
diff --git a/pkgs/applications/misc/dstask/default.nix b/pkgs/applications/misc/dstask/default.nix
new file mode 100644
index 000000000000..fae7809d25a2
--- /dev/null
+++ b/pkgs/applications/misc/dstask/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, buildGoModule, fetchFromGitHub }:
+
+buildGoModule rec {
+  pname = "dstask";
+  version = "0.18";
+
+  src = fetchFromGitHub {
+    owner = "naggie";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "16z5zlfj955pzsj0l58835slvpchdaq2vbyx2fjzi6y9xn1z2nd1";
+  };
+
+  # Set vendorSha256 to null because dstask vendors its dependencies (meaning
+  # that third party dependencies are stored in the repository).
+  #
+  # Ref <https://github.com/NixOS/nixpkgs/pull/87383#issuecomment-633204382>
+  # and <https://github.com/NixOS/nixpkgs/blob/d4226e3a4b5fcf988027147164e86665d382bbfa/pkgs/development/go-modules/generic/default.nix#L18>
+  vendorSha256 = null;
+
+  # The ldflags reduce the executable size by stripping some debug stuff.
+  # The other variables are set so that the output of dstask version shows the
+  # git ref and the release version from github.
+  # Ref <https://github.com/NixOS/nixpkgs/pull/87383#discussion_r432097657>
+  buildFlagsArray = [ ''
+    -ldflags=-w -s
+    -X "github.com/naggie/dstask.VERSION=${version}"
+    -X "github.com/naggie/dstask.GIT_COMMIT=v${version}"
+  '' ];
+
+  subPackages = [ "cmd/dstask.go" ];
+
+  meta = with stdenv.lib; {
+    description = "Command line todo list with super-reliable git sync";
+    homepage = src.meta.homepage;
+    license = licenses.mit;
+    maintainers = with maintainers; [ stianlagstad foxit64 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index a6802d642cab..a65835ccf488 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -22072,6 +22072,8 @@ in
 
   taskwarrior = callPackage ../applications/misc/taskwarrior { };
 
+  dstask = callPackage ../applications/misc/dstask { };
+
   tasksh = callPackage ../applications/misc/tasksh { };
 
   taskserver = callPackage ../servers/misc/taskserver { };