about summary refs log tree commit diff
path: root/pkgs/by-name/ne
diff options
context:
space:
mode:
authorClément DOUIN <clement.douin@posteo.net>2024-04-15 15:17:10 +0200
committerClément DOUIN <clement.douin@posteo.net>2024-04-17 10:23:24 +0200
commitd97925912aeec5065f910b5992404a632e6b2ebe (patch)
treeaf45435e39cf7aa3394527a3242ab8a97fd7368e /pkgs/by-name/ne
parent26c7dc31d209e10f9e9f0e724ce3a349be9a0160 (diff)
neverest: init at 1.0.0-beta
Diffstat (limited to 'pkgs/by-name/ne')
-rw-r--r--pkgs/by-name/ne/neverest/package.nix63
1 files changed, 63 insertions, 0 deletions
diff --git a/pkgs/by-name/ne/neverest/package.nix b/pkgs/by-name/ne/neverest/package.nix
new file mode 100644
index 0000000000000..04e68b52841f6
--- /dev/null
+++ b/pkgs/by-name/ne/neverest/package.nix
@@ -0,0 +1,63 @@
+{ lib
+, rustPlatform
+, fetchFromSourcehut
+, stdenv
+, pkg-config
+, darwin
+, installShellFiles
+, installShellCompletions ? stdenv.hostPlatform == stdenv.buildPlatform
+, installManPages ? stdenv.hostPlatform == stdenv.buildPlatform
+, notmuch
+, buildNoDefaultFeatures ? false
+, buildFeatures ? []
+}:
+
+rustPlatform.buildRustPackage rec {
+  # Learn more about available cargo features at:
+  #  - <https://pimalaya.org/neverest/cli/latest/installation.html#cargo>
+  #  - <https://git.sr.ht/~soywod/neverest-cli/tree/master/item/Cargo.toml#L18>
+  inherit buildNoDefaultFeatures buildFeatures;
+
+  pname = "neverest";
+  version = "1.0.0-beta";
+
+  src = fetchFromSourcehut {
+    owner = "~soywod";
+    repo = "${pname}-cli";
+    rev = "v${version}";
+    hash = "sha256-3PSJyhxrOCiuHUeVHO77+NecnI5fN5EZfPhYizuYvtE=";
+  };
+
+  cargoSha256 = "i5or8oBtjGqOfTfwB7dYXn/OPgr5WEWNEvC0WdCCG+c=";
+
+  nativeBuildInputs = [ pkg-config ]
+    ++ lib.optional (installManPages || installShellCompletions) installShellFiles;
+
+  buildInputs = [ ]
+    ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ AppKit Cocoa Security ])
+    ++ lib.optional (builtins.elem "notmuch" buildFeatures) notmuch;
+
+  # TODO: unit tests temporarily broken, remove this line for the next
+  # beta.2 release
+  doCheck = false;
+
+  postInstall = lib.optionalString installManPages ''
+    mkdir -p $out/man
+    $out/bin/neverest man $out/man
+    installManPage $out/man/*
+  '' + lib.optionalString installShellCompletions ''
+    installShellCompletion --cmd neverest \
+      --bash <($out/bin/neverest completion bash) \
+      --fish <($out/bin/neverest completion fish) \
+      --zsh <($out/bin/neverest completion zsh)
+  '';
+
+  meta = with lib; {
+    description = "CLI to synchronize, backup and restore emails";
+    mainProgram = "neverest";
+    homepage = "https://pimalaya.org/neverest/cli/v${version}/";
+    changelog = "https://git.sr.ht/~soywod/neverest-cli/tree/v${version}/item/CHANGELOG.md";
+    license = licenses.mit;
+    maintainers = with maintainers; [ soywod ];
+  };
+}