3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/security/pass/extensions/import.nix
Maximilian Bosch 2b674912b4
passExtensions.pass-import: 2.6 -> 3.1
ChangeLog: https://github.com/roddhjav/pass-import/blob/v3.1/CHANGELOG.rst#31---2020-10-25

* Make sure that all features are enabled by adding `pykeepass`,
  `filemagic` etc.

* Patch & use `setup.py` to make sure that everything gets installed
  properly into `$out`.

Co-authored-by: elseym <elseym@me.com>
2020-12-04 22:33:53 +01:00

50 lines
1.3 KiB
Nix

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