nixpkgs/pkgs/tools/security/pass/extensions/import.nix

50 lines
1.3 KiB
Nix
Raw Normal View History

2021-02-20 23:02:01 +00:00
{ lib, stdenv, fetchFromGitHub, pythonPackages, makeWrapper, fetchpatch }:
2018-04-18 20:27:03 +01:00
let
2019-10-28 10:30:12 +00:00
pythonEnv = pythonPackages.python.withPackages (p: [
p.defusedxml
p.setuptools
p.pyaml
p.pykeepass
p.filemagic
p.cryptography
p.secretstorage
2019-10-28 10:30:12 +00:00
]);
2018-04-18 20:27:03 +01:00
in stdenv.mkDerivation rec {
pname = "pass-import";
version = "3.1";
2018-04-18 20:27:03 +01:00
src = fetchFromGitHub {
owner = "roddhjav";
repo = "pass-import";
rev = "v${version}";
sha256 = "sha256-nH2xAqWfMT+Brv3z9Aw6nbvYqArEZjpM28rKsRPihqA=";
2018-04-18 20:27:03 +01:00
};
patches = [ ./0001-Fix-installation-with-Nix.patch ];
2018-04-18 20:27:03 +01:00
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ pythonEnv ];
makeFlags = [ "DESTDIR=${placeholder "out"}" ];
2018-04-18 20:27:03 +01:00
postInstall = ''
wrapProgram $out/bin/pimport \
--prefix PATH : "${pythonEnv}/bin" \
--prefix PYTHONPATH : "$out/${pythonPackages.python.sitePackages}"
2018-04-18 20:27:03 +01:00
wrapProgram $out/lib/password-store/extensions/import.bash \
--prefix PATH : "${pythonEnv}/bin" \
--prefix PYTHONPATH : "$out/${pythonPackages.python.sitePackages}"
2018-04-18 20:27:03 +01:00
'';
meta = with lib; {
2018-04-18 20:27:03 +01:00
description = "Pass extension for importing data from existing password managers";
homepage = "https://github.com/roddhjav/pass-import";
2018-04-18 20:27:03 +01:00
license = licenses.gpl3Plus;
maintainers = with maintainers; [ lovek323 fpletz tadfisher ];
2018-04-18 20:27:03 +01:00
platforms = platforms.unix;
};
}