From 7dfdf9defd0b2352c40bd8e3230d7f094e22bea8 Mon Sep 17 00:00:00 2001 From: Michael Thomson Date: Thu, 23 Oct 2025 14:06:36 -0400 Subject: [PATCH] update: email and notmuch --- hosts/macbook/home.nix | 2 +- modules/home-manager/emacs/init.el | 55 +++++----- modules/home-manager/email-personal.nix | 139 ++---------------------- 3 files changed, 35 insertions(+), 161 deletions(-) diff --git a/hosts/macbook/home.nix b/hosts/macbook/home.nix index 77d03eb..a19af3f 100644 --- a/hosts/macbook/home.nix +++ b/hosts/macbook/home.nix @@ -10,7 +10,7 @@ ../../modules/home-manager/kitty.nix ../../modules/home-manager/zsh.nix ../../modules/home-manager/tmux.nix - ../../modules/home-manager/email-work.nix + ../../modules/home-manager/email-personal.nix ../../modules/home-manager/password-store ../../modules/home-manager/taskwarrior.nix ../../modules/home-manager/kubernetes.nix diff --git a/modules/home-manager/emacs/init.el b/modules/home-manager/emacs/init.el index 4839773..2cec837 100644 --- a/modules/home-manager/emacs/init.el +++ b/modules/home-manager/emacs/init.el @@ -22,7 +22,7 @@ (ring-bell-function 'ignore) (split-width-threshold 300) (switch-to-buffer-obey-display-actions t) - (tab-width 4) + (indent-tabs-mode nil) (treesit-font-lock-level 4) (truncate-lines t) (use-dialog-box nil) @@ -546,35 +546,30 @@ :config (global-diff-hl-mode)) -;; LSP Mode -;; (use-package lsp-mode -;; :ensure t -;; :init -;; (setq lsp-keymap-prefix "C-c l") -;; (defun my/lsp-mode-setup-completion () -;; (setf (alist-get 'styles (alist-get 'lsp-capf completion-category-defaults)) -;; '(orderless))) -;; :hook ((typescript-ts-mode . lsp) -;; (tsx-ts-mode . lsp) -;; (js-ts-mode . lsp) -;; ;; if you want which-key integration -;; (lsp-mode . lsp-enable-which-key-integration) -;; (lsp-completion-mode . my/lsp-mode-setup-completion)) -;; :commands lsp -;; :config -;; (setq lsp-eslint-server-command '("vscode-eslint-language-server" "--stdio")) -;; (lsp-register-client -;; (make-lsp-client -;; :new-connection (lsp-stdio-connection '("tailwindcss-language-server" "--stdio")) -;; :activation-fn (lsp-activate-on "typescriptreact" "typescript" "css" "html") -;; :add-on? t -;; :notification-handlers (ht ("@/tailwindCSS/projectInitialized" #'ignore) -;; ("@/tailwindCSS/projectsDestroyed" #'ignore))))) +;; EMAIL ----------- +(use-package notmuch + :ensure t + :bind (("C-c m" . notmuch-hello)) + :custom + (notmuch-search-oldest-first nil) + (notmuch-saved-searches + '((:name "inbox" :query "tag:inbox") + (:name "unread" :query "tag:unread") + (:name "sent" :query "tag:sent") + (:name "drafts" :query "tag:draft"))) + :config + (setq sendmail-program "msmtp") + (setq notmuch-fcc-dirs nil)) -;; (use-package lsp-ui -;; :ensure t -;; :commands lsp-ui-mode -;; :config -;; (setq lsp-ui-sideline-enable nil)) +(use-package ol-notmuch + :ensure t + :bind + ("C-c l" . org-store-link)) + +;; EPUBS ---------- +(use-package nov + :ensure t + :config + ((add-to-list 'auto-mode-alist '("\\.epub\\'" . nov-mode)))) (provide 'init) diff --git a/modules/home-manager/email-personal.nix b/modules/home-manager/email-personal.nix index 855f129..9da0baa 100644 --- a/modules/home-manager/email-personal.nix +++ b/modules/home-manager/email-personal.nix @@ -1,91 +1,34 @@ { pkgs, - osConfig, - lib, - ... + osConfig, + lib, + ... }: { - home.packages = with pkgs; [ - w3m - inetutils - ]; - - services = { -# mbsync = { -# enable = true; -# frequency = "*-*-* *:*/5:00"; -# postExec = "\${pkgs.notmuch} new"; -# }; - vdirsyncer = { - enable = true; -#frequency = "*-*-* *:*/5:00"; - }; - }; - programs = { - aerc = { - enable = true; - extraConfig = { - ui = { - sort = "-r arrival"; - threading-enabled = true; - fuzzy-complete = true; - }; - general = { - default-save-path = "~/Downloads"; - log-file = "~/.aerc.log"; - unsafe-accounts-conf = true; - }; - compose = { - address-book-cmd = "notmuch address \"%s\""; - }; - filters = { - "text/plain" = "colorize"; - "text/calendar" = "calendar"; - "text/html" = "html | colorize"; - }; - }; - }; msmtp = { enable = true; }; mbsync = { enable = true; }; - lieer = { - enable = true; - }; - vdirsyncer = { - enable = true; - }; - khal = { - enable = true; - }; - khard = { - enable = true; - }; - mu = { - enable = true; - }; + afew = { + enable = true; + }; notmuch = { enable = true; new.tags = [ "new" ]; hooks = { postNew = '' - notmuch tag +sent -new tag:new from:michael@michaelthomson.dev - - notmuch tag +cal attachment:.ics - - notmuch tag +inbox +unread -new "tag:new" - ''; + afew --tag --new + ''; preNew = '' mbsync -a - ''; + ''; }; }; }; accounts = { - email = { accounts.personal = { primary = true; @@ -93,9 +36,6 @@ realName = "Michael Thomson"; userName = "michael@michaelthomson.dev"; passwordCommand = "rbw get --folder email michael@michaelthomson.dev"; - aerc = { - enable = true; - }; mbsync = { enable = true; create = "both"; @@ -121,67 +61,6 @@ notmuch = { enable = true; }; - mu = { - enable = true; - }; - }; - }; - calendar = { - basePath = ".calendar"; - accounts.personal = { - primary = true; - primaryCollection = "personal"; - remote = { - type = "caldav"; - url = "https://nextcloud.michaelthomson.dev/remote.php/dav"; - userName = "michael@michaelthomson.dev"; - passwordCommand = [ - "rbw" - "get" - "nextcloud.michaelthomson.dev" - ]; - }; - vdirsyncer = { - enable = true; - auth = "basic"; - collections = ["personal"]; - }; - khal = { - enable = true; - type = "calendar"; - }; - }; - }; - contact = { - basePath = ".contacts"; - accounts.personal = { - local = { - type = "filesystem"; - fileExt = ".vcf"; - }; - remote = { - type = "carddav"; - url = "https://nextcloud.michaelthomson.dev/remote.php/dav"; - userName = "michael@michaelthomson.dev"; - passwordCommand = [ - "rbw" - "get" - "nextcloud.michaelthomson.dev" - ]; - }; - vdirsyncer = { - enable = true; - auth = "basic"; - collections = ["contacts"]; - }; - khal = { - enable = true; - collections = ["contacts"]; - }; - khard = { - enable = true; - defaultCollection = "contacts"; - }; }; }; };