2017-06-11 02:26:51 +02:00
|
|
|
;;; tools/password-store/config.el -*- lexical-binding: t; -*-
|
|
|
|
|
2017-06-11 18:01:03 +02:00
|
|
|
(defvar +pass-user-fields '("login" "user" "username" "email")
|
|
|
|
"A list of fields for `+pass/ivy' to search for the username.")
|
|
|
|
|
2017-06-12 02:38:16 +02:00
|
|
|
(defvar +pass-url-fields '("url" "site" "location")
|
|
|
|
"A list of fields for `+pass/ivy' to search for the username.")
|
|
|
|
|
2017-06-11 18:01:03 +02:00
|
|
|
|
|
|
|
;;
|
|
|
|
;; Plugins
|
|
|
|
;;
|
|
|
|
|
2018-05-25 00:46:11 +02:00
|
|
|
;; `password-store'
|
|
|
|
(setq password-store-password-length 12)
|
2017-06-11 02:26:51 +02:00
|
|
|
|
2018-05-29 17:50:55 +02:00
|
|
|
;; 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)
|
|
|
|
|
2017-06-11 02:26:51 +02:00
|
|
|
|
2018-05-25 00:46:11 +02:00
|
|
|
;; `pass'
|
2018-05-29 17:50:55 +02:00
|
|
|
(after! pass
|
2018-06-15 03:15:34 +02:00
|
|
|
(set-env! "PASSWORD_STORE_DIR")
|
2018-06-15 02:58:12 +02:00
|
|
|
(set-evil-initial-state! 'pass-mode 'emacs)
|
|
|
|
(set-popup-rule! "^\\*Password-Store"
|
2018-05-25 00:46:11 +02:00
|
|
|
'((side . left) (size . 0.25))
|
|
|
|
'((quit)))
|
2018-06-03 15:46:00 +02:00
|
|
|
(define-key! pass-mode-map
|
|
|
|
"j" #'pass-next-entry
|
|
|
|
"k" #'pass-prev-entry
|
|
|
|
"d" #'pass-kill
|
|
|
|
"\C-j" #'pass-next-directory
|
|
|
|
"\C-k" #'pass-next-directory))
|
2017-06-11 16:40:57 +02:00
|
|
|
|
|
|
|
|
2017-07-29 00:00:19 +02:00
|
|
|
;; Is built into Emacs 26+
|
2018-05-25 00:46:11 +02:00
|
|
|
(when (and EMACS26+ (featurep! +auth))
|
|
|
|
(auth-source-pass-enable))
|