Rewrite tools/password-store API

This commit is contained in:
Henrik Lissner 2018-05-29 17:50:55 +02:00
parent 3b4aca6270
commit e88f84fd02
3 changed files with 135 additions and 58 deletions

View file

@ -14,11 +14,19 @@
;; `password-store'
(setq password-store-password-length 12)
;; Fix hard-coded password-store location; respect PASSWORD_STORE_DIR envvar
(defun +password-store*read-entry (entry)
"Return a string with the file content of ENTRY."
(with-temp-buffer
(insert-file-contents
(expand-file-name (format "%s.gpg" entry) (password-store-dir)))
(buffer-substring-no-properties (point-min) (point-max))))
(advice-add #'auth-source-pass--read-entry :override #'+password-store*read-entry)
;; `pass'
(def-package! pass
:defer t
:config
(after! pass
(set! :env "PASSWORD_STORE_DIR")
(set! :evil-state 'pass-mode 'emacs)
(set! :popup "^\\*Password-Store"
'((side . left) (size . 0.25))