2023-09-11 20:23:04 +02:00
|
|
|
|
{
|
|
|
|
|
config,
|
|
|
|
|
lib,
|
|
|
|
|
pkgs,
|
|
|
|
|
...
|
|
|
|
|
}:
|
|
|
|
|
with lib; let
|
2019-12-18 09:08:23 +01:00
|
|
|
|
defaultEncrypt = pkgs.emacsPackages.trivialBuild rec {
|
|
|
|
|
pname = "defaultencrypt";
|
|
|
|
|
version = "ba07acc8e9fd692534c39c7cdad0a19dc0d897d9";
|
|
|
|
|
|
|
|
|
|
src = pkgs.fetchFromGitLab {
|
|
|
|
|
owner = "lechten";
|
|
|
|
|
repo = pname;
|
|
|
|
|
rev = version;
|
|
|
|
|
sha256 = "1ln7h1syx7yi7bqvirv90mk4rvwxg4zm1wvfcvhfh64s3hqrbfgl";
|
|
|
|
|
};
|
|
|
|
|
};
|
2023-09-11 20:23:04 +02:00
|
|
|
|
in
|
|
|
|
|
mkIf (elem "emacs::mu4e" config.machine.pkgs) {
|
|
|
|
|
programs.emacs.init.usePackage.pinentry = {
|
|
|
|
|
enable = true;
|
|
|
|
|
command = ["pinentry-start"];
|
|
|
|
|
hook = ["(after-init . pinentry-start)"];
|
|
|
|
|
};
|
2019-12-18 09:08:23 +01:00
|
|
|
|
|
2023-09-11 20:23:04 +02:00
|
|
|
|
programs.emacs.init.usePackage.mu4e = {
|
|
|
|
|
enable = true;
|
|
|
|
|
package = epkgs: null;
|
|
|
|
|
command = ["mu4e"];
|
|
|
|
|
diminish = ["mu4e-mode"];
|
|
|
|
|
hook = [
|
|
|
|
|
"(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))))''
|
|
|
|
|
];
|
|
|
|
|
bind = {"\t" = "'company-complete-common";};
|
|
|
|
|
bindLocal = rec {
|
|
|
|
|
mu4e-headers-mode-map = {
|
|
|
|
|
"C-+" = "nil";
|
|
|
|
|
"C--" = "nil";
|
|
|
|
|
};
|
|
|
|
|
mu4e-view-mode-map = mu4e-headers-mode-map;
|
2020-01-26 17:35:22 +01:00
|
|
|
|
};
|
2023-09-11 20:23:04 +02:00
|
|
|
|
init = ''
|
|
|
|
|
;; (add-to-list 'load-path "${defaultEncrypt}/share/emacs/site-lisp")
|
|
|
|
|
;; (require 'jl-encrypt)
|
|
|
|
|
'';
|
|
|
|
|
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)
|
2019-11-11 18:41:30 +01:00
|
|
|
|
|
2023-09-11 20:23:04 +02:00
|
|
|
|
;;rename files when moving
|
|
|
|
|
;;NEEDED FOR MBSYNC
|
|
|
|
|
(setq mu4e-change-filenames-when-moving t)
|
2019-11-11 18:41:30 +01:00
|
|
|
|
|
2023-09-11 20:23:04 +02:00
|
|
|
|
(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-11-11 18:41:30 +01:00
|
|
|
|
|
2023-09-11 20:23:04 +02: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
|
|
|
|
|
2023-09-11 20:23:04 +02: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 = ''
|
2024-05-09 13:26:18 +02:00
|
|
|
|
:load-path "${pkgs.mu.mu4e}/share/emacs/site-lisp/mu4e"
|
2023-09-11 20:23:04 +02:00
|
|
|
|
'';
|
|
|
|
|
};
|
2019-11-17 23:13:50 +01:00
|
|
|
|
|
2023-09-11 20:23:04 +02:00
|
|
|
|
programs.emacs.init.usePackage.mu4e-alert = {
|
|
|
|
|
enable = true;
|
|
|
|
|
# hook = [ "after-init . mu4e-alert-enable-mode-line-display" ];
|
|
|
|
|
};
|
2019-11-17 23:13:50 +01:00
|
|
|
|
|
2023-09-11 20:23:04 +02:00
|
|
|
|
# programs.emacs.init.usePackage.org-mu4e = {
|
|
|
|
|
# enable = (elem "emacs::org" config.machine.pkgs);
|
|
|
|
|
# };
|
2019-11-17 23:13:50 +01:00
|
|
|
|
|
2023-09-11 20:23:04 +02:00
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
|
mu
|
|
|
|
|
isync
|
|
|
|
|
];
|
|
|
|
|
}
|