2019-11-11 18:41:30 +01:00
|
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
2019-12-18 09:08:23 +01:00
|
|
|
|
let
|
|
|
|
|
defaultEncrypt = pkgs.emacsPackages.trivialBuild rec {
|
|
|
|
|
pname = "defaultencrypt";
|
|
|
|
|
version = "ba07acc8e9fd692534c39c7cdad0a19dc0d897d9";
|
|
|
|
|
|
|
|
|
|
src = pkgs.fetchFromGitLab {
|
|
|
|
|
owner = "lechten";
|
|
|
|
|
repo = pname;
|
|
|
|
|
rev = version;
|
|
|
|
|
sha256 = "1ln7h1syx7yi7bqvirv90mk4rvwxg4zm1wvfcvhfh64s3hqrbfgl";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
in mkIf (elem "emacs::mu4e" config.machine.pkgs) {
|
|
|
|
|
programs.emacs.init.usePackage.pinentry = {
|
|
|
|
|
enable = true;
|
|
|
|
|
command = [ "pinentry-start" ];
|
|
|
|
|
hook = [ "(after-init . pinentry-start)" ];
|
|
|
|
|
};
|
|
|
|
|
|
2019-11-11 18:41:30 +01:00
|
|
|
|
programs.emacs.init.usePackage.mu4e = {
|
|
|
|
|
enable = true;
|
|
|
|
|
package = epkgs: null;
|
|
|
|
|
command = [ "mu4e" ];
|
|
|
|
|
diminish = [ "mu4e-mode" ];
|
|
|
|
|
hook = [
|
2019-12-18 09:08:23 +01:00
|
|
|
|
"(mu4e-view-mode . visual-line-mode)"
|
|
|
|
|
"(mu4e-compose-mode . flyspell-mode)"
|
|
|
|
|
''(message-send . (lambda ()
|
|
|
|
|
(unless (yes-or-no-p "Send this message?")
|
|
|
|
|
(signal 'quit nil))))''
|
2019-11-11 18:41:30 +01:00
|
|
|
|
];
|
|
|
|
|
bind = { "\t" = "'company-complete-common"; };
|
2020-01-26 17:35:22 +01:00
|
|
|
|
bindLocal = rec {
|
|
|
|
|
mu4e-headers-mode-map = {
|
|
|
|
|
"C-+" = "nil";
|
|
|
|
|
"C--" = "nil";
|
|
|
|
|
};
|
|
|
|
|
mu4e-view-mode-map = mu4e-headers-mode-map;
|
|
|
|
|
};
|
2019-12-18 09:08:23 +01:00
|
|
|
|
init = ''
|
|
|
|
|
(add-to-list 'load-path "${defaultEncrypt}/share/emacs/site-lisp")
|
|
|
|
|
(require 'jl-encrypt)
|
|
|
|
|
'';
|
2019-11-11 18:41:30 +01:00
|
|
|
|
config = ''
|
|
|
|
|
(setq mail-user-agent 'mu4e-user-agent)
|
|
|
|
|
(setq org-mu4e-link-query-in-headers-mode t)
|
|
|
|
|
(setq mu4e-maildir "~/.mail/Mail")
|
|
|
|
|
(setq mu4e-get-mail-command "${pkgs.isync}/bin/mbsync -a")
|
|
|
|
|
(setq mu4e-context-policy 'pick-first)
|
|
|
|
|
(setq mu4e-change-filenames-when-moving t)
|
|
|
|
|
(setq starttls-use-gnutls t)
|
|
|
|
|
(setq message-send-mail-function 'smtpmail-send-it)
|
|
|
|
|
(setq mu4e-update-interval 300)
|
|
|
|
|
(setq mu4e-use-fancy-chars t)
|
|
|
|
|
(setq mu4e-view-show-addresses t)
|
|
|
|
|
(setq mu4e-headers-show-threads t)
|
|
|
|
|
(setq mu4e-headers-skip-duplicates t)
|
|
|
|
|
(setq mail-user-agent 'mu4e-user-agent)
|
|
|
|
|
(defvaralias 'mu4e-compose-signature 'message-signature)
|
|
|
|
|
(setq-default mu4e-save-multiple-attachments-without-asking t)
|
|
|
|
|
(setq-default mu4e-view-show-addresses t)
|
|
|
|
|
(setq-default mu4e-confirm-quit nil)
|
|
|
|
|
(setq-default mu4e-hide-index-messages t)
|
|
|
|
|
(setq-default mu4e-index-update-in-background t)
|
|
|
|
|
(setq mu4e-compose-in-new-frame nil)
|
|
|
|
|
|
|
|
|
|
;;rename files when moving
|
|
|
|
|
;;NEEDED FOR MBSYNC
|
|
|
|
|
(setq mu4e-change-filenames-when-moving t)
|
|
|
|
|
|
|
|
|
|
(setq mu4e-html2text-command "iconv -c -t utf-8 | ${pkgs.pandoc}/bin/pandoc -f html -t plain")
|
|
|
|
|
(setq mu4e-view-show-images t)
|
|
|
|
|
(when (fboundp 'imagemagick-register-types)
|
|
|
|
|
(imagemagick-register-types))
|
|
|
|
|
(setq message-kill-buffer-on-exit t)
|
|
|
|
|
|
2019-12-18 09:08:23 +01:00
|
|
|
|
;; Encryption Stuff
|
|
|
|
|
(setq mml-secure-openpgp-sign-with-sender t)
|
|
|
|
|
;; (setq mm-sign-option ‘guided’)
|
|
|
|
|
(setq epa-pinentry-mode 'loopback)
|
|
|
|
|
;; mailAcc config goes here
|
|
|
|
|
(load-file "~/.emacs.d/mu4e.el")
|
2019-11-11 18:41:30 +01:00
|
|
|
|
|
|
|
|
|
(defun my-browse-url-firefox-privately (url &optional new-window)
|
|
|
|
|
"Make firefox open URL in private-browsing window."
|
|
|
|
|
(interactive (browse-url-interactive-arg "URL: "))
|
|
|
|
|
(let ((process-environment (browse-url-process-environment)))
|
|
|
|
|
(apply 'start-process
|
|
|
|
|
(concat "firefox " url)
|
|
|
|
|
nil
|
|
|
|
|
browse-url-firefox-program
|
|
|
|
|
(list "-private-window" url))))
|
|
|
|
|
(setq browse-url-browser-function 'my-browse-url-firefox-privately)
|
|
|
|
|
(add-to-list 'mu4e-view-actions
|
|
|
|
|
'("ViewInBrowser" . mu4e-action-view-in-browser) t)
|
|
|
|
|
'';
|
|
|
|
|
extraConfig = ''
|
2019-12-18 09:08:23 +01:00
|
|
|
|
:load-path "${pkgs.mu}/share/emacs/site-lisp/mu4e"
|
2019-11-11 18:41:30 +01:00
|
|
|
|
'';
|
|
|
|
|
};
|
2019-11-17 23:13:50 +01:00
|
|
|
|
|
2019-11-11 18:41:30 +01:00
|
|
|
|
programs.emacs.init.usePackage.mu4e-alert = {
|
|
|
|
|
enable = true;
|
2019-12-18 09:08:23 +01:00
|
|
|
|
# hook = [ "after-init . mu4e-alert-enable-mode-line-display" ];
|
2019-11-17 23:13:50 +01:00
|
|
|
|
};
|
|
|
|
|
|
2019-12-18 09:08:23 +01:00
|
|
|
|
# programs.emacs.init.usePackage.org-mu4e = {
|
|
|
|
|
# enable = (elem "emacs::org" config.machine.pkgs);
|
|
|
|
|
# };
|
2019-11-17 23:13:50 +01:00
|
|
|
|
|
2019-12-18 09:08:23 +01:00
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
|
mu
|
2019-11-11 18:41:30 +01:00
|
|
|
|
isync
|
|
|
|
|
];
|
|
|
|
|
}
|