1{
2 lib,
3 rustPlatform,
4 fetchFromGitLab,
5 installShellFiles,
6 pkg-config,
7 python3,
8 glib,
9 gpgme,
10 gtk3,
11 stdenv,
12}:
13
14rustPlatform.buildRustPackage rec {
15 pname = "prs";
16 version = "0.5.2";
17
18 src = fetchFromGitLab {
19 owner = "timvisee";
20 repo = "prs";
21 rev = "refs/tags/v${version}";
22 hash = "sha256-W5wNmZWjSsM6Xe50fCpa/aGsJ8PDyh2INs1Oj86et04=";
23 };
24
25 cargoHash = "sha256-IRWOY+FudPH2AEUTplwUWKK431x+CRkVF3VXxVWFKeI=";
26
27 nativeBuildInputs = [
28 gpgme
29 installShellFiles
30 pkg-config
31 python3
32 ];
33
34 cargoBuildFlags = [
35 "--no-default-features"
36 "--features=alias,backend-gpgme,clipboard,notify,select-fzf-bin,select-skim,tomb,totp"
37 ];
38
39 buildInputs = [
40 glib
41 gpgme
42 gtk3
43 ];
44
45 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
46 for shell in bash fish zsh; do
47 installShellCompletion --cmd prs --$shell <($out/bin/prs internal completions $shell --stdout)
48 done
49 '';
50
51 meta = {
52 description = "Secure, fast & convenient password manager CLI using GPG and git to sync";
53 homepage = "https://gitlab.com/timvisee/prs";
54 changelog = "https://gitlab.com/timvisee/prs/-/blob/v${version}/CHANGELOG.md";
55 license = with lib.licenses; [
56 lgpl3Only # lib
57 gpl3Only # everything else
58 ];
59 maintainers = with lib.maintainers; [ colemickens ];
60 mainProgram = "prs";
61 };
62}