From ec4dc7e3465e1645b43cf5533924a35846734448 Mon Sep 17 00:00:00 2001 From: Henry Mortimer Date: Thu, 15 Apr 2021 01:41:17 +0100 Subject: [PATCH] passExtensions.pass-import: install extension script and completion The changes added in 40b9f4e meant that running the extension from within pass, i.e. running `pass import` no longer worked because the extension script didn't get installed and the completion scripts for pimport don't get installed. This commit fixes that by manually copying and wrapping the extension script and completion scripts --- pkgs/tools/security/pass/extensions/import.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/tools/security/pass/extensions/import.nix b/pkgs/tools/security/pass/extensions/import.nix index be2492112c3f..28a9e8f57756 100644 --- a/pkgs/tools/security/pass/extensions/import.nix +++ b/pkgs/tools/security/pass/extensions/import.nix @@ -4,6 +4,7 @@ , python3Packages , gnupg , pass +, makeWrapper }: python3Packages.buildPythonApplication rec { @@ -50,6 +51,16 @@ python3Packages.buildPythonApplication rec { $out/bin/pimport --list-exporters --list-importers ''; + postInstall = '' + mkdir -p $out/lib/password-store/extensions + cp ${src}/scripts/import.bash $out/lib/password-store/extensions/import.bash + wrapProgram $out/lib/password-store/extensions/import.bash \ + --prefix PATH : "${python3Packages.python.withPackages(_: propagatedBuildInputs)}/bin" \ + --prefix PYTHONPATH : "$out/${python3Packages.python.sitePackages}" \ + --run "export PREFIX" + cp -r ${src}/share $out/ + ''; + meta = with lib; { description = "Pass extension for importing data from existing password managers"; homepage = "https://github.com/roddhjav/pass-import";