2022-07-18 16:21:45 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, python3
|
|
|
|
, dbus
|
|
|
|
, gnupg
|
|
|
|
, coreutils
|
|
|
|
, nixosTests
|
|
|
|
}:
|
2020-11-06 00:33:48 +00:00
|
|
|
|
|
|
|
python3.pkgs.buildPythonApplication rec {
|
|
|
|
pname = "pass-secret-service";
|
|
|
|
# PyPI has old alpha version. Since then the project has switched from using a
|
|
|
|
# seemingly abandoned D-Bus package pydbus and started using maintained
|
|
|
|
# dbus-next. So let's use latest from GitHub.
|
2022-07-18 16:21:45 +00:00
|
|
|
version = "unstable-2022-03-21";
|
2020-11-06 00:33:48 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mdellweg";
|
|
|
|
repo = "pass_secret_service";
|
2022-07-18 16:21:45 +00:00
|
|
|
rev = "149f8557e07098eee2f46561eea61e83255ac59b";
|
|
|
|
sha256 = "sha256-+/pFi6+K8rl0Ihm6cp/emUQVtau6+Apl8/VEr9AI0Xs=";
|
2020-11-06 00:33:48 +00:00
|
|
|
};
|
|
|
|
|
2022-07-18 16:21:45 +00:00
|
|
|
patches = [
|
|
|
|
# Only needed until https://github.com/mdellweg/pass_secret_service/pull/30
|
|
|
|
# is merged.
|
|
|
|
./int_from_bytes-deprecation-fix.patch
|
|
|
|
];
|
2020-11-06 00:33:48 +00:00
|
|
|
|
|
|
|
# Need to specify session.conf file for tests because it won't be found under
|
|
|
|
# /etc/ in check phase.
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Makefile \
|
2021-12-06 16:07:01 +00:00
|
|
|
--replace "dbus-run-session" "dbus-run-session --config-file=${dbus}/share/dbus-1/session.conf" \
|
2022-07-18 16:21:45 +00:00
|
|
|
--replace '-p $(relpassstore)' '-p $(PASSWORD_STORE_DIR)' \
|
|
|
|
--replace 'pytest-3' 'pytest'
|
|
|
|
|
|
|
|
substituteInPlace systemd/org.freedesktop.secrets.service \
|
|
|
|
--replace "/bin/false" "${coreutils}/bin/false"
|
|
|
|
substituteInPlace systemd/dbus-org.freedesktop.secrets.service \
|
|
|
|
--replace "/usr/local" "$out"
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p "$out/share/dbus-1/services/" "$out/lib/systemd/user/"
|
|
|
|
cp systemd/org.freedesktop.secrets.service "$out/share/dbus-1/services/"
|
|
|
|
cp systemd/dbus-org.freedesktop.secrets.service "$out/lib/systemd/user/"
|
2020-11-06 00:33:48 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
|
|
|
click
|
|
|
|
cryptography
|
|
|
|
dbus-next
|
|
|
|
decorator
|
|
|
|
pypass
|
|
|
|
secretstorage
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs =
|
|
|
|
let
|
|
|
|
ps = python3.pkgs;
|
|
|
|
in
|
|
|
|
[
|
|
|
|
dbus
|
|
|
|
gnupg
|
|
|
|
ps.pytest
|
|
|
|
ps.pytest-asyncio
|
|
|
|
ps.pypass
|
|
|
|
];
|
|
|
|
|
2022-07-18 16:21:45 +00:00
|
|
|
checkTarget = "test";
|
|
|
|
|
|
|
|
passthru.tests.pass-secret-service = nixosTests.pass-secret-service;
|
2020-11-06 00:33:48 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Libsecret D-Bus API with pass as the backend";
|
|
|
|
homepage = "https://github.com/mdellweg/pass_secret_service/";
|
2021-01-15 22:18:51 +00:00
|
|
|
license = lib.licenses.gpl3Only;
|
|
|
|
platforms = lib.platforms.all;
|
2022-07-18 16:21:45 +00:00
|
|
|
maintainers = with lib.maintainers; [ jluttine aidalgol ];
|
2020-11-06 00:33:48 +00:00
|
|
|
};
|
|
|
|
}
|