btrbk: add mainProgram
[NixPkgs.git] / pkgs / by-name / pr / prs / package.nix
blob02f6d0725f907a82a21fc2b7bdc9065abe981e0e
1 { lib
2 , rustPlatform
3 , fetchFromGitLab
4 , installShellFiles
5 , pkg-config
6 , python3
7 , dbus
8 , glib
9 , gpgme
10 , gtk3
11 , libxcb
12 , libxkbcommon
13 , stdenv
16 rustPlatform.buildRustPackage rec {
17   pname = "prs";
18   version = "0.5.1";
20   src = fetchFromGitLab {
21     owner = "timvisee";
22     repo = "prs";
23     rev = "refs/tags/v${version}";
24     hash = "sha256-MvQ0B35NF/AuGHBMa201FkFlU/UX0WXMcBRxTJwpUFw=";
25   };
27   cargoHash = "sha256-YDcAjBIdUboOKvGSnGW6b1JVbhQaB3ccXcSmK78M7DI=";
29   postPatch = ''
30     # The GPGME backend is recommended
31     for f in "gtk3/Cargo.toml" "cli/Cargo.toml"; do
32       substituteInPlace "$f" --replace \
33         'default = ["backend-gnupg-bin"' 'default = ["backend-gpgme"'
34     done
35   '';
37   nativeBuildInputs = [ gpgme installShellFiles pkg-config python3 ];
39   buildInputs = [
40     dbus
41     glib
42     gpgme
43     gtk3
44     libxcb
45     libxkbcommon
46   ];
48   postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
49     for shell in bash fish zsh; do
50       installShellCompletion --cmd prs --$shell <($out/bin/prs internal completions $shell --stdout)
51     done
52   '';
54   meta = with lib; {
55     description = "Secure, fast & convenient password manager CLI using GPG and git to sync";
56     homepage = "https://gitlab.com/timvisee/prs";
57     changelog = "https://gitlab.com/timvisee/prs/-/blob/v${version}/CHANGELOG.md";
58     license = with licenses; [
59       lgpl3Only # lib
60       gpl3Only  # everything else
61     ];
62     maintainers = with maintainers; [ dotlambda ];
63     mainProgram = "prs";
64   };