From a4f20edddbcc0fb30ab97644608b72f4d9a8894b Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Fri, 24 May 2024 11:15:37 -0600 Subject: [PATCH] configs/emacs: add mu4e - all: switch back to just putting emacs on the gui machines - europa: install mu support things --- configs/emacs.nix | 2 +- configs/emacs.org | 89 ++++++++++++++++++++++++++++++++++++++++ default.nix | 2 - gui/default.nix | 2 + hosts/europa/default.nix | 2 + hosts/h/default.nix | 2 + 6 files changed, 96 insertions(+), 3 deletions(-) diff --git a/configs/emacs.nix b/configs/emacs.nix index d09150a..31238b7 100644 --- a/configs/emacs.nix +++ b/configs/emacs.nix @@ -46,6 +46,7 @@ let graphviz haskellPackages.lsp ispell + isync nil nixpkgs-fmt nodePackages.prettier @@ -54,7 +55,6 @@ let perlPackages.PLS rubyPackages.solargraph sleek - sumneko-lua-language-server texlive.combined.scheme-full tree-sitter typescript diff --git a/configs/emacs.org b/configs/emacs.org index 922fd02..12fb150 100644 --- a/configs/emacs.org +++ b/configs/emacs.org @@ -537,3 +537,92 @@ Custom agenda commands for various things. (org-agenda-ndays 7) (org-agenda-log-mode-items '(state)))))) #+end_src + +* mu4e +~mu~ has been the best mail client for me on emacs. + +** Initializing mu + +The defaults ~mu~ uses make no sense. ~~/.cache~ is for .. caching data, not +persistent databases.. So we init things with sane defaults: + +#+begin_src shell +mu init --muhome=/home/qbit/.mu -m /home/qbit/Maildir/fastmail/ --my-address="aaron@bolddaemon.com" +#+end_src + +** General mail configuration + +#+begin_src emacs-lisp + (require 'smtpmail) + (setq user-mail-address "aaron@bolddaemon.com" + user-full-name "Aaron Bieber" + message-send-mail-function 'smtpmail-send-it + message-kill-buffer-on-exit t + smtpmail-smtp-user "qbit@fastmail.com" + smtpmail-smtp-server "smtp.fastmail.com" + smtpmail-smtp-service 465 + smtpmail-default-smtp-server "smtp.fastmail.com" + smtpmail-stream-type 'ssl) +#+end_src + +** mu4e specific configs +#+begin_src emacs-lisp + (use-package mu4e + :init + (require 'mu4e-speedbar) + (setq mail-user-agent 'mu4e-user-agent + read-mail-command 'mu4e + mu4e-get-mail-command "mbsync fastmail" + mu4e-update-interval 420 + mu4e-compose-context-policy nil + mu4e-context-policy 'pick-first + mu4e-drafts-folder "/Drafts" + mu4e-sent-folder "/Sent Items" + mu4e-trash-folder "/Trash" + mu4e-maildir-shortcuts + '( ("/INBOX" . ?i) + ("/Archive" . ?a) + ("/Sent Items" . ?s)) + org-mu4e-link-query-in-headers-mode nil + mu4e-attachment-dir + (lambda (fname mtype) + (cond + ((and fname (string-match "\\.diff$" fname)) "~/patches") + ((and fname (string-match "\\.patch$" fname)) "~/patches") + ((and fname (string-match "\\.diff.gz$" fname)) "~/patches") + (t "~/Downloads"))) + mu4e-bookmarks + `(( :name "Inbox" + :query "maildir:/Inbox AND NOT flag:trashed" + :key ?i) + ( :name "TODO" + :query "maildir:/TODO AND NOT flag:trashed" + :key ?T) + ( :name "Unread messages" + :query "flag:unread AND NOT flag:trashed AND NOT list:ports-changes.openbsd.org AND NOT list:source-changes.openbsd.org" + :key ?u) + ( :name "Today's messages" + :query "date:today..now" + :key ?d) + ( :name "Hackers" + :query "list:hackers.openbsd.org AND NOT flag:trashed" + :key ?h) + ( :name "Bugs" + :query "list:bugs.openbsd.org AND NOT flag:trashed" + :key ?b) + ( :name "Tech" + :query "list:tech.openbsd.org AND NOT flag:trashed" + :key ?t) + ( :name "Ports" + :query "list:ports.openbsd.org AND NOT flag:trashed" + :key ?p) + ( :name "Misc" + :query "list:misc.openbsd.org AND NOT flag:trashed" + :key ?m) + ( :name "9front" + :query "list:9front.9front.org AND NOT flag:trashed" + :key ?9) + ( :name "GOT" + :query "list:gameoftrees.openbsd.org AND NOT flag:trashed" + :key ?g)))) +#+end_src diff --git a/default.nix b/default.nix index 65986c9..359a0df 100644 --- a/default.nix +++ b/default.nix @@ -20,7 +20,6 @@ let inherit config; inherit xinlib; }; - myEmacs = pkgs.callPackage ./configs/emacs.nix { inherit isUnstable; }; in { imports = [ @@ -181,7 +180,6 @@ in lz4 minisign mosh - myEmacs nix-diff nix-index nix-output-monitor diff --git a/gui/default.nix b/gui/default.nix index c797ab2..8e27be7 100644 --- a/gui/default.nix +++ b/gui/default.nix @@ -12,6 +12,7 @@ let inherit (inputs.beyt.packages.${pkgs.system}) beyt; firefox = import ../configs/firefox.nix { inherit pkgs; }; rage = pkgs.writeScriptBin "rage" (import ../bins/rage.nix { inherit pkgs; }); + myEmacs = pkgs.callPackage ./configs/emacs.nix { inherit isUnstable; }; rpr = pkgs.writeScriptBin "rpr" (import ../bins/rpr.nix { inherit (pkgs) hut gh tea; }); @@ -100,6 +101,7 @@ with lib; { vlc zeal + myEmacs (callPackage ../configs/helix.nix { }) ]); }; diff --git a/hosts/europa/default.nix b/hosts/europa/default.nix index 8b2b4c2..78d246d 100644 --- a/hosts/europa/default.nix +++ b/hosts/europa/default.nix @@ -349,11 +349,13 @@ in gqrx hackrf inkscape + isync jan jujutsu klavaro koreader minicom + mu nheko nix-index nixpkgs-review diff --git a/hosts/h/default.nix b/hosts/h/default.nix index 8641fe5..bc3667e 100644 --- a/hosts/h/default.nix +++ b/hosts/h/default.nix @@ -679,6 +679,8 @@ in proxy_set_header Host $host:$server_port; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Ssl on; + proxy_set_header Authorization $http_authorization; + proxy_pass_header Authorization; proxy_read_timeout 300; proxy_connect_timeout 300; proxy_pass http://127.0.0.1:8044;