2021-03-09 03:18:52 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitLab
|
2021-04-25 03:57:28 +00:00
|
|
|
, installShellFiles
|
2021-03-09 03:18:52 +00:00
|
|
|
, pkg-config
|
|
|
|
, python3
|
|
|
|
, dbus
|
|
|
|
, glib
|
|
|
|
, gpgme
|
|
|
|
, gtk3
|
|
|
|
, libxcb
|
2021-08-05 21:33:18 +00:00
|
|
|
, libxkbcommon
|
2024-09-19 14:19:46 +00:00
|
|
|
, stdenv
|
2021-03-09 03:18:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "prs";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "0.5.1";
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "timvisee";
|
|
|
|
repo = "prs";
|
2023-01-11 07:51:40 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-MvQ0B35NF/AuGHBMa201FkFlU/UX0WXMcBRxTJwpUFw=";
|
2021-03-09 03:18:52 +00:00
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
cargoHash = "sha256-YDcAjBIdUboOKvGSnGW6b1JVbhQaB3ccXcSmK78M7DI=";
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# The GPGME backend is recommended
|
|
|
|
for f in "gtk3/Cargo.toml" "cli/Cargo.toml"; do
|
|
|
|
substituteInPlace "$f" --replace \
|
|
|
|
'default = ["backend-gnupg-bin"' 'default = ["backend-gpgme"'
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-04-25 03:57:28 +00:00
|
|
|
nativeBuildInputs = [ gpgme installShellFiles pkg-config python3 ];
|
2021-03-09 03:18:52 +00:00
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
buildInputs = [
|
|
|
|
dbus
|
|
|
|
glib
|
|
|
|
gpgme
|
|
|
|
gtk3
|
|
|
|
libxcb
|
|
|
|
libxkbcommon
|
|
|
|
];
|
2021-03-09 03:18:52 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
2021-04-25 03:57:28 +00:00
|
|
|
for shell in bash fish zsh; do
|
|
|
|
installShellCompletion --cmd prs --$shell <($out/bin/prs internal completions $shell --stdout)
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Secure, fast & convenient password manager CLI using GPG and git to sync";
|
|
|
|
homepage = "https://gitlab.com/timvisee/prs";
|
|
|
|
changelog = "https://gitlab.com/timvisee/prs/-/blob/v${version}/CHANGELOG.md";
|
|
|
|
license = with licenses; [
|
|
|
|
lgpl3Only # lib
|
|
|
|
gpl3Only # everything else
|
|
|
|
];
|
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "prs";
|
2021-03-09 03:18:52 +00:00
|
|
|
};
|
|
|
|
}
|