Various additions / changes

Switch email from mu/mu4e to notmuch, with associated service changes

Add elfeed config, enable useful minor-modes

Slight restructure of file layout
This commit is contained in:
Evie Litherland-Smith 2023-10-24 08:06:35 +01:00
parent 815f603128
commit 16babc3f15
10 changed files with 138 additions and 97 deletions

View file

@ -3,6 +3,7 @@
{ {
home.packages = with pkgs; [ davmail ]; home.packages = with pkgs; [ davmail ];
programs = { programs = {
msmtp.enable = true;
mbsync = { mbsync = {
enable = true; enable = true;
groups.inboxes = { groups.inboxes = {
@ -11,13 +12,18 @@
outlook = [ "INBOX" ]; outlook = [ "INBOX" ];
}; };
}; };
msmtp.enable = true; notmuch = {
mu.enable = true; enable = true;
maildir.synchronizeFlags = true;
hooks.postInsert = "${pkgs.libnotify}/bin/notify-send notmuch updated";
};
afew.enable = true;
}; };
services = { services = {
mbsync = { mbsync = {
enable = true; enable = true;
frequency = "*:0/30"; frequency = "*:0/30";
postExec = "${pkgs.notmuch}/bin/notmuch new";
}; };
imapnotify.enable = true; imapnotify.enable = true;
}; };
@ -50,6 +56,7 @@
enable = lib.mkDefault accountEnabled; enable = lib.mkDefault accountEnabled;
boxes = [ "INBOX" ]; boxes = [ "INBOX" ];
onNotify = "${pkgs.isync}/bin/mbsync proton"; onNotify = "${pkgs.isync}/bin/mbsync proton";
onNotifyPost = "${pkgs.notmuch}/bin/notmuch new";
extraConfig = { extraConfig = {
wait = 300; wait = 300;
tls = false; tls = false;
@ -72,7 +79,7 @@
auth = "login"; auth = "login";
}; };
}; };
mu.enable = lib.mkDefault accountEnabled; notmuch.enable = lib.mkDefault accountEnabled;
}; };
icloud = let accountEnabled = true; icloud = let accountEnabled = true;
in rec { in rec {
@ -89,6 +96,7 @@
enable = lib.mkDefault accountEnabled; enable = lib.mkDefault accountEnabled;
boxes = [ "INBOX" ]; boxes = [ "INBOX" ];
onNotify = "${pkgs.isync}/bin/mbsync icloud"; onNotify = "${pkgs.isync}/bin/mbsync icloud";
onNotifyPost = "${pkgs.notmuch}/bin/notmuch new";
extraConfig.wait = 300; extraConfig.wait = 300;
}; };
mbsync = { mbsync = {
@ -100,7 +108,7 @@
subFolders = "Verbatim"; subFolders = "Verbatim";
}; };
msmtp.enable = lib.mkDefault accountEnabled; msmtp.enable = lib.mkDefault accountEnabled;
mu.enable = lib.mkDefault accountEnabled; notmuch.enable = lib.mkDefault accountEnabled;
}; };
outlook = let outlook = let
host = "127.0.0.1"; host = "127.0.0.1";
@ -127,6 +135,7 @@
enable = lib.mkDefault accountEnabled; enable = lib.mkDefault accountEnabled;
boxes = [ "INBOX" ]; boxes = [ "INBOX" ];
onNotify = "${pkgs.isync}/bin/mbsync outlook"; onNotify = "${pkgs.isync}/bin/mbsync outlook";
onNotifyPost = "${pkgs.notmuch}/bin/notmuch new";
extraConfig = { extraConfig = {
wait = 300; wait = 300;
tls = false; tls = false;
@ -150,7 +159,7 @@
auth = "login"; auth = "login";
}; };
}; };
mu.enable = lib.mkDefault accountEnabled; notmuch.enable = lib.mkDefault accountEnabled;
}; };
}; };
}; };

View file

@ -0,0 +1,46 @@
#+title: Elfeed
* root :elfeed:
** Blogs :blogs:
*** [[https://www.zotero.org/blog/feed/][Zotero]]
** News :news:
*** Linux :linux:
**** [[https://systemcrafters.net/rss/news.xml][Systemcrafters News]]
** Programming :programming:
*** Python :python:
*** Rust :rust:
**** [[https://this-week-in-rust.org/rss.xml][This Week in Rust]]
** YouTube :youtube:videos:
*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCp6F1mQGuaXiDj5otWBmIjg][EckhartsLadder]]
*** Explainers :explainers:
**** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCBa659QWEk1AI4Tg--mrJ2A][Tom Scott]]
**** [[https://www.youtube.com/feeds/videos.xml?channel_id=UC2C_jShtL725hvbm1arSV9w][CGP Grey]]
**** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCEIwxahdLz7bap-VDs9h35A][Steve Mould]]
**** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCHnyfMqiRRG1u-2MsSQLbXA][Veritasium]]
*** Games :games:
**** Reviews :reviews:
***** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCWCw2Sd7RlYJ2yuNVHDWNOA][The Jimquisition]]
**** Minecraft :minecraft:
***** [[https://www.youtube.com/feeds/videos.xml?channel_id=UChFur_NwVSbUozOcF_F2kMg][Mumbo Jumbo]] :mumbojumbo:
****** [[https://www.youtube.com/feeds/videos.xml?playlist_id=PLFm1tTY1NA4ebglc7QWni3Vx6Zzdx0PQu][Hermitcraft Season 9]] :hermitcraft:
***** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCR9Gcq0CMm6YgTzsDxAxjOQ][Grian]]
***** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCodkNmk9oWRTIYZdr_HuSlg][GoodTimesWithScar]]
***** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCuQYHhF6on6EXXO-_i_ClHQ][FalseSymmetry]]
***** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCU9pX8hKcrx06XfOB-VQLdw][xisumavoid]]
**** Zelda :zelda:
***** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCVBEE2TpAUD4T2OP7fHKCXg][Gossip Geist]]
**** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCweDKPSF65wRw5VHFUJYiow][Curious Archive]]
**** Outside Xbox :outsidexbox:
***** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCKk076mm-7JjLxJcFSXIPJA][Outside Xbox]]
***** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCjf6YzmyaKi8880IXMJ5kGA][Outside Xtra]]
*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCGwu0nbY2wSkW8N-cghnLpA][Jaiden Animations]]
*** Linux :linux:
**** [[https://www.youtube.com/feeds/videos.xml?channel_id=UC5UAwBUum7CPN5buc-_N1Fw][The Linux Experiment]]
**** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCAiiOTio8Yu69c3XnR7nQBQ][System Crafters]]
*** STEM :STEM:
**** Physics :physics:
***** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCeXksuVW8H1x9v4gh7DWoyQ][Physics for the Birds]]
***** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCUHW94eEFW7hkUMVaZz4eDg][minutephysics]]
**** Maths :maths:
***** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCSju5G2aFaWMqn-_0YBtq5A][Stand-up Maths]]
***** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCRfo-DAifrP3lzcxUHtGm_A][Tom Rocks Maths]]
**** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCsXVk37bltHxD1rDPwtNM8Q][Kurzgesagt - In a Nutshell]]

View file

@ -19,9 +19,6 @@
(add-to-list 'load-path (expand-file-name "modules" crafted-emacs-home)) (add-to-list 'load-path (expand-file-name "modules" crafted-emacs-home))
;;; Configuration phase ;;; Configuration phase
(require 'custom-email-config)
(require 'crafted-completion-config) (require 'crafted-completion-config)
(require 'crafted-defaults-config) (require 'crafted-defaults-config)
(require 'crafted-ide-config) (require 'crafted-ide-config)
@ -32,21 +29,37 @@
(require 'crafted-workspaces-packages) (require 'crafted-workspaces-packages)
(require 'crafted-writing-packages) (require 'crafted-writing-packages)
(require 'custom-email-config)
(require 'custom-feed-config)
(require 'custom-ide-config)
(require 'custom-ligatures-config)
(require 'custom-project-config)
;;; Optional configuration ;;; Optional configuration
(setq user-full-name "Evie Litherland-Smith" (setq user-full-name "Evie Litherland-Smith"
user-mail-address "evie@xenia.me.uk" user-mail-address "evie@xenia.me.uk"
sendmail-program (executable-find "msmtp")
send-mail-function #'smtpmail-send-it
message-sendmail-f-is-evil t
message-sendmail-extra-arguments '("--read-envelope-from")
message-send-mail-function #'message-send-mail-with-sendmail
display-line-numbers 'relative display-line-numbers 'relative
fill-column 80) fill-column 80)
(global-display-fill-column-indicator-mode)
;; Theme settings ;; Theme settings
(tool-bar-mode -1)
(scroll-bar-mode -1)
(setq use-dialog-box nil)
(load-theme 'doom-tokyo-night t) (load-theme 'doom-tokyo-night t)
(add-to-list 'default-frame-alist '(font . "FiraCode Nerd Font-12")) (add-to-list 'default-frame-alist '(font . "FiraCode Nerd Font-12"))
(global-prettify-symbols-mode) (global-prettify-symbols-mode)
(set-frame-parameter nil 'alpha-background 80) (set-frame-parameter nil 'alpha-background 80)
(add-to-list 'default-frame-alist '(alpha-background . 80)) (add-to-list 'default-frame-alist '(alpha-background . 80))
;; Extra minor-modes
(which-key-mode)
;; Extra functions ;; Extra functions
(defun crafted-startup-example/display-startup-time () (defun crafted-startup-example/display-startup-time ()

View file

@ -0,0 +1,6 @@
(notmuch-indicator-mode)
(setq notmuch-search-oldest-first nil
notmuch-show-logo nil
notmuch-indicator-args '((:terms "tag:unread and tag:inbox" :label "@")))
(provide 'custom-email-config)

View file

@ -0,0 +1,9 @@
(setq elfeed-db-directory "~/.elfeed/db/"
elfeed-enclosure-default-dir "~/.elfeed/enclosures/"
elfeed-goodies/entry-pane-position 'bottom
elfeed-goodies/powerline-default-separator 'utf-8)
;; (add-hook 'elfeed-search-mode-hook #'elfeed-update)
(require 'elfeed)
(require 'elfeed-tube)
(elfeed-tube-setup)
(provide 'custom-feed-config)

View file

@ -0,0 +1,8 @@
(setq direnv-always-show-summary nil)
(require 'treesit-auto)
(global-treesit-auto-mode +1)
(apheleia-global-mode +1)
(direnv-mode +1)
(provide 'custom-ide-config)

View file

@ -55,4 +55,6 @@
"Setup Fira Code Symbols" "Setup Fira Code Symbols"
(set-fontset-font t '(#Xe100 . #Xe16f) "Fira Code Symbol")) (set-fontset-font t '(#Xe100 . #Xe16f) "Fira Code Symbol"))
(provide 'fira-code-mode) (fira-code-mode)
(provide 'custom-ligatures-config)

View file

@ -0,0 +1,8 @@
(setq project-switch-use-entire-map t
project-switch-commands
'((project-dired "Browse directory")
(project-find-file "Find file")
(project-find-regexp "Find regexp")
(project-find-dir "Find directory")
(project-eshell "Eshell")))
(provide 'custom-project-config)

View file

@ -4,8 +4,10 @@
imports = [ ./formatters.nix ./lsp_servers.nix ]; imports = [ ./formatters.nix ./lsp_servers.nix ];
stylix.targets.emacs.enable = false; stylix.targets.emacs.enable = false;
xdg.configFile = { xdg.configFile = {
"emacs/init.el".source = ./init.el; emacs = {
"emacs/modules".source = ./modules; source = ./config;
recursive = true;
};
"emacs/crafted-emacs".source = crafted-emacs; "emacs/crafted-emacs".source = crafted-emacs;
}; };
services.git-sync = { services.git-sync = {
@ -23,7 +25,7 @@
# Theme # Theme
doom-themes doom-themes
# crafted-completion-packages # completion-packages
cape cape
consult consult
corfu corfu
@ -34,43 +36,51 @@
orderless orderless
vertico vertico
# crafted-ide-packages # ide-packages
treesit-auto
editorconfig editorconfig
aggressive-indent aggressive-indent
ibuffer-project ibuffer-project
# custom
# tree-sitter grammars
treesit-grammars.with-all-grammars treesit-grammars.with-all-grammars
treesit-auto
apheleia
direnv
nix-mode
rust-mode
# crafted-org-packages # org-packages
denote denote
org-appear org-appear
# crafted-ui-packages # ui-packages
all-the-icons all-the-icons
elisp-demos elisp-demos
helpful helpful
# crafted-workspaces-packages # workspaces-packages
tabspaces tabspaces
# crafted-writing-packages # writing-packages
markdown-mode markdown-mode
pandoc-mode pandoc-mode
auctex auctex
auctex-latexmk auctex-latexmk
# custom-email-packages # email-packages
mu4e notmuch
mu4e-alert notmuch-indicator
# feed-packages
elfeed
elfeed-org
elfeed-webkit
elfeed-tube
elfeed-tube-mpv
# Additional packages # Additional packages
which-key
magit magit
vterm vterm
direnv
nix-mode
rust-mode
])); ]));
}; };
home = { home = {

View file

@ -1,70 +0,0 @@
(setq mu4e-maildir "~/Mail"
mu4e-attachment-dir "~/Downloads"
mu4e-get-mail-command "mbsync --pull-new inboxes"
mu4e-update-interval (* 5 60) ; Every 5 minutes
mu4e-sent-messages-behavior 'sent
mu4e-change-filenames-when-moving t
mu4e-alert-modeline-formatter 'mu4e-alert-default-mode-line-formatter
sendmail-program (executable-find "msmtp")
send-mail-function #'smtpmail-send-it
message-sendmail-f-is-evil t
message-sendmail-extra-arguments '("--read-envelope-from")
message-send-mail-function #'message-send-mail-with-sendmail
mu4e-maildir-shortcuts '((:maildir "/Proton/Inbox/" :key ?p)
(:maildir "/iCloud/Inbox/" :key ?i)
(:maildir "/Outlook/Inbox/" :key ?o))
mu4e-modeline-all-read '("R:" . "󰑇 ")
mu4e-modeline-all-clear '("C:" . "󰚭 ")
mu4e-modeline-new-items '("N:" . "󰎔 ")
mu4e-modeline-unread-items '("U:" . "󰮒 ")
mu4e-search-full-label '("F" . "󱊖 ")
mu4e-search-hide-label '("H" . "󰘓 ")
mu4e-search-related-label '("R" . "󰌹 ")
mu4e-search-skip-duplicates-label '("D" . "󰆑 ")
mu4e-search-threaded-label'("T" . "󱇫 "))
(require 'mu4e)
(setq mu4e-contexts
(list
(make-mu4e-context
:name "Proton"
:match-func
(lambda (msg)
(when msg)
(string-prefix-p "/Proton" (mu4e-message-field msg :maildir)))
:vars
'((user-mail-address . "e.litherlandsmith@proton.me")
(mu4e-sent-folder . "/Proton/Sent")
(mu4e-drafts-folder . "/Proton/Drafts")
(mu4e-trash-folder . "/Proton/Trash")
(mu4e-refile-folder . "/Proton/Archive"))
)
(make-mu4e-context
:name "iCloud"
:match-func
(lambda (msg)
(when msg)
(string-prefix-p "/iCloud" (mu4e-message-field msg :maildir)))
:vars
'((user-mail-address . "e.litherlandsmith@icloud.com")
(mu4e-sent-folder . "/iCloud/Sent")
(mu4e-drafts-folder . "/iCloud/Drafts")
(mu4e-trash-folder . "/iCloud/Trash")
(mu4e-refile-folder . "/iCloud/Archive"))
)
(make-mu4e-context
:name "Outlook"
:match-func
(lambda (msg)
(when msg)
(string-prefix-p "/Outlook" (mu4e-message-field msg :maildir)))
:vars
'((user-mail-address . "evie.litherland-smith@ukaea.uk")
(mu4e-sent-folder . "/Outlook/Sent")
(mu4e-drafts-folder . "/Outlook/Drafts")
(mu4e-trash-folder . "/Outlook/Trash")
(mu4e-refile-folder . "/Outlook/Archive"))
)
))
(provide 'custom-email-config)