about summary refs log tree commit diff
path: root/pkgs/tools/security/sheesy-cli/default.nix
blob: dfa26c0399a1c992489013bf84ff8a37043d12cb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{ lib, stdenv, rustPlatform, fetchCrate, installShellFiles
, libgpg-error, gpgme, gettext, openssl, Security
}:

rustPlatform.buildRustPackage rec {
  pname = "sheesy-cli";
  version = "4.0.11";

  src = fetchCrate {
    inherit version pname;
    hash = "sha256-rJ/V9pJgmqERgjD0FQ/oqhZQlIeN4/3ECx15/FOUQdA=";
  };

  cargoSha256 = "159a5ph1gxwcgahyr8885lq3c1w76nxzfrfdpyqixqrr7jzx2rd3";
  cargoDepsName = pname;

  nativeBuildInputs = [ libgpg-error gpgme gettext installShellFiles ];

  buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security ];

  buildFeatures = [ "vault" "extract" "completions" "substitute" "process" ];

  checkFeatures = [ ];

  cargoBuildFlags = [ "--bin" "sy" ];

  postInstall = ''
    installShellCompletion --cmd sy \
      --bash <($out/bin/sy completions bash) \
      --fish <($out/bin/sy completions fish) \
      --zsh <($out/bin/sy completions zsh)
  '';

  meta = with lib; {
    description = "'share-secrets-safely' CLI to interact with GPG/pass-like vaults";
    homepage = "https://share-secrets-safely.github.io/cli/";
    changelog = "https://github.com/share-secrets-safely/cli/releases/tag/${version}";
    license = with licenses; [ lgpl21Only ];
    maintainers = with maintainers; [ devhell ];
    mainProgram = "sy";
  };
}