about summary refs log tree commit diff
path: root/pkgs/by-name
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2024-04-19 13:24:37 +0200
committerGitHub <noreply@github.com>2024-04-19 13:24:37 +0200
commit6eacd2ac58ed7897081fb2a86c544cc729a4cde9 (patch)
treee93906dc61bba974178cc0c56185de2ccb220611 /pkgs/by-name
parentae4e2c93b7c72776b5fecc85f80c21c8e7ee9192 (diff)
parent62f12e3a325aa9eac5324471be25c2bbf8f055ff (diff)
Merge pull request #303632 from mlaradji/add-taskwarrior-3
Add taskwarrior3 and taskchampion-sync-server
Diffstat (limited to 'pkgs/by-name')
-rw-r--r--pkgs/by-name/ta/taskchampion-sync-server/package.nix29
-rw-r--r--pkgs/by-name/ta/taskwarrior3/package.nix83
2 files changed, 112 insertions, 0 deletions
diff --git a/pkgs/by-name/ta/taskchampion-sync-server/package.nix b/pkgs/by-name/ta/taskchampion-sync-server/package.nix
new file mode 100644
index 0000000000000..8ddefa8374c1f
--- /dev/null
+++ b/pkgs/by-name/ta/taskchampion-sync-server/package.nix
@@ -0,0 +1,29 @@
+{
+  lib,
+  rustPlatform,
+  fetchFromGitHub,
+}:
+rustPlatform.buildRustPackage rec {
+  pname = "taskchampion-sync-server";
+  version = "0.4.1-unstable-2024-04-08";
+  src = fetchFromGitHub {
+      owner = "GothenburgBitFactory";
+      repo = "taskchampion-sync-server";
+      rev = "31cb732f0697208ef9a8d325a79688612087185a";
+      fetchSubmodules = false;
+      sha256 = "sha256-CUgXJcrCOenbw9ZDFBody5FAvpT1dsZBojJk3wOv9U4=";
+    };
+
+  cargoHash = "sha256-TpShnVQ2eFNLXJzOTlWVaLqT56YkP4zCGCf3yVtNcvI=";
+
+  # cargo tests fail when checkType="release" (default)
+  checkType = "debug";
+
+  meta = {
+    description = "Sync server for Taskwarrior 3";
+    license = lib.licenses.mit;
+    homepage = "https://github.com/GothenburgBitFactory/taskchampion-sync-server";
+    maintainers = with lib.maintainers; [mlaradji];
+    mainProgram = "taskchampion-sync-server";
+  };
+}
diff --git a/pkgs/by-name/ta/taskwarrior3/package.nix b/pkgs/by-name/ta/taskwarrior3/package.nix
new file mode 100644
index 0000000000000..5b9372189c72b
--- /dev/null
+++ b/pkgs/by-name/ta/taskwarrior3/package.nix
@@ -0,0 +1,83 @@
+{
+  rustPlatform,
+  rustc,
+  cargo,
+  corrosion,
+  lib,
+  stdenv,
+  fetchFromGitHub,
+  cmake,
+  libuuid,
+  gnutls,
+  python3,
+  xdg-utils,
+  installShellFiles,
+}:
+stdenv.mkDerivation rec {
+    pname = "taskwarrior";
+    version = "3.0.0-unstable-2024-04-07";
+    src = fetchFromGitHub {
+      owner = "GothenburgBitFactory";
+      repo = "taskwarrior";
+      rev = "fd306712b85dda3ea89de4e617aebeb98b2ede80";
+      fetchSubmodules = true;
+      sha256 = "sha256-vzfHq/LHfnTx6CVGFCuO6W5aSqj1jVqldMdmyciSDDk=";
+    };
+
+  postPatch = ''
+    substituteInPlace src/commands/CmdNews.cpp \
+      --replace "xdg-open" "${lib.getBin xdg-utils}/bin/xdg-open"
+  '';
+
+  nativeBuildInputs = [
+    cmake
+    libuuid
+    python3
+    installShellFiles
+    corrosion
+    cargo
+    rustc
+    rustPlatform.cargoSetupHook
+  ];
+
+  doCheck = true;
+  preCheck = ''
+    patchShebangs --build test
+  '';
+  checkTarget = "test";
+
+  cargoDeps = rustPlatform.fetchCargoTarball {
+    name = "${pname}-${version}-cargo-deps";
+    inherit src;
+    sourceRoot = src.name;
+    hash = "sha256-zQca/1tI/GUCekKhrg2iSL+h69SH6Ttsj3MqwDKj8HQ=";
+  };
+  cargoRoot = "./";
+  preConfigure = ''
+    export CMAKE_PREFIX_PATH="${corrosion}:$CMAKE_PREFIX_PATH"
+  '';
+
+  postInstall = ''
+    # ZSH is installed automatically from some reason, only bash and fish need
+    # manual installation
+    installShellCompletion --cmd task \
+      --bash $out/share/doc/task/scripts/bash/task.sh \
+      --fish $out/share/doc/task/scripts/fish/task.fish
+    rm -r $out/share/doc/task/scripts/bash
+    rm -r $out/share/doc/task/scripts/fish
+    # Install vim and neovim plugin
+    mkdir -p $out/share/vim-plugins
+    mv $out/share/doc/task/scripts/vim $out/share/vim-plugins/task
+    mkdir -p $out/share/nvim
+    ln -s $out/share/vim-plugins/task $out/share/nvim/site
+  '';
+
+  meta = with lib; {
+    description = "Highly flexible command-line tool to manage TODO lists";
+    homepage = "https://taskwarrior.org";
+    license = licenses.mit;
+    maintainers = with maintainers; [marcweber oxalica mlaradji];
+    mainProgram = "task";
+    platforms = platforms.unix;
+  };
+}