From 44e63b0e4e4f6ef4f27d7acb51a51649010676c0 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Fri, 10 Feb 2023 21:29:26 +0200 Subject: emacs: Update setup for GuixSD --- .emacs.d/emacs.org | 148 +++++++++++++++++++++++++++-------------------------- .emacs.d/init.el | 137 ++++++++++++++++++++++++------------------------- 2 files changed, 142 insertions(+), 143 deletions(-) (limited to '.emacs.d') diff --git a/.emacs.d/emacs.org b/.emacs.d/emacs.org index 893bcab..424106b 100644 --- a/.emacs.d/emacs.org +++ b/.emacs.d/emacs.org @@ -52,10 +52,19 @@ We check the ~$HOSTNAME~, if it's one of my devices running GuixSD. we use ~guix-emacs-autoload-packages~ to load emacs packages installed using guix if ~t~ + If you are running GuixSD, replace the following hostnames ~fsociety~ or ~heisenberg~ with your own ~$HOSTNAME~ #+begin_src emacs-lisp - (when (or (string= (system-name) "fsociety") - (string= (system-name) "heisenberg")) + ;; When guix t, load emacs packages + (when (require 'guix t) (add-to-list 'load-path "~/.guix-profile/share/emacs/site-lisp") (guix-emacs-autoload-packages)) + + (with-eval-after-load 'geiser-guile + (add-to-list 'geiser-guile-load-path "~/dotfiles/.config/guix")) + + ;; Personal Information + (setq user-full-name "Thanos Apollo") + (setq user-mail-address "public@thanosapollo.com") + (setq copyright-names-regexp + (format "%s <%s>" user-full-name user-mail-address)) #+end_src ** Define and install packages *** List of required packages @@ -1036,78 +1045,71 @@ In macOS, I have installed it through homebrew. * mu4e | Email Configuration -# ** MacOS -# If it's a mac, load from homebrew path - -# #+begin_src emacs-lisp -# (when (equal system-type 'darwin) -# (use-package mu4e -# :load-path "/opt/homebrew/share/emacs/site-lisp/mu/mu4e/")) -# #+end_src - #+begin_src emacs-lisp -(when (equal system-type 'darwin) - (use-package mu4e - :load-path "/opt/homebrew/share/emacs/site-lisp/mu/mu4e/")) - -(require 'mu4e) - -(setq mu4e-update-interval (* 10 60)) -(setq mu4e-get-mail-command "mbsync -a") -(setq mu4e-maildir-list "~/Mail/Inbox") - -(defun set-mu4e-context (context-name full-name mail-address signature server) - "Return a mu4e context named CONTEXT-NAME with :match-func matching - folder name CONTEXT-NAME in Maildir. The context's `user-mail-address', - `user-full-name' and `mu4e-compose-signature'`smtpmail-smpt-server' is set to MAIL-ADDRESS - FULL-NAME SIGNATURE and SERVER respectively. - Special folders are set to context specific folders." - (let ((dir-name (concat "/" context-name))) - (make-mu4e-context - :name context-name - ;; we match based on the maildir of the message - :match-func - `(lambda (msg) - (when msg - (string-match-p - ,(concat "^" dir-name) - (mu4e-message-field msg :maildir)))) - :vars - `((user-mail-address . ,mail-address) - (user-full-name . ,full-name) - (mu4e-sent-folder . ,(concat dir-name "/Sent")) - (mu4e-drafts-folder . ,(concat dir-name "/Drafts")) - (mu4e-trash-folder . ,(concat dir-name "/Trash")) - (mu4e-trash-folder . ,(concat dir-name "/Starred")) - (mu4e-refile-folder . ,(concat dir-name "/Archive")) - (smtpmail-smtp-service . ,465) - (smtpmail-smtp-server . ,server) - (mu4e-compose-signature . ,signature))))) -;;Fixing duplicate UID errors when using mbsync and mu4e -(setq mu4e-change-filenames-when-moving t) - -(setq mu4e-maildir-shortcuts - '(("/Fastmail/Inbox" . ?i) - ("/Fastmail/Sent" . ?s) - ;; ("/Gmail/Trash" . ?t) - ;; ("/Gmail/Drafts" . ?d) - ;; ("/Gmail/[Gmail]/All Mail" . ?a - )) - -(setq mu4e-contexts - `(, (set-mu4e-context - "Fastmail" "Thanos Apollo" - "thanos@thanosapollo.com" "Thanos\nhttps://thanosapollo.com/public" - "smtp.fastmail.com"))) - -;; (setq smtpmail-smtp-service 465 -;; smtpmail-stream-type 'ssl -;; smtpmail-smtp-server "smtp.fastmail.com") - - - -(setq message-send-mail-function 'smtpmail-send-it - smtpmail-stream-type 'ssl) + ;; In macOS, load mu4e through homebrew + (when (equal system-type 'darwin) + (use-package mu4e + :load-path "/opt/homebrew/share/emacs/site-lisp/mu/mu4e/")) + ;; Check if we have mu4e available + ;; if t load mu4e settings + (when (require 'mu4e t) + (setq mu4e-update-interval (* 10 60)) + (setq mu4e-get-mail-command "mbsync -a") + (setq mu4e-maildir-list "~/Mail/Inbox") + + (defun set-mu4e-context (context-name full-name mail-address signature server) + "Return a mu4e context named CONTEXT-NAME with :match-func matching + folder name CONTEXT-NAME in Maildir. The context's `user-mail-address', + `user-full-name' and `mu4e-compose-signature'`smtpmail-smpt-server' is set to MAIL-ADDRESS + FULL-NAME SIGNATURE and SERVER respectively. + Special folders are set to context specific folders." + (let ((dir-name (concat "/" context-name))) + (make-mu4e-context + :name context-name + ;; we match based on the maildir of the message + :match-func + `(lambda (msg) + (when msg + (string-match-p + ,(concat "^" dir-name) + (mu4e-message-field msg :maildir)))) + :vars + `((user-mail-address . ,mail-address) + (user-full-name . ,full-name) + (mu4e-sent-folder . ,(concat dir-name "/Sent")) + (mu4e-drafts-folder . ,(concat dir-name "/Drafts")) + (mu4e-trash-folder . ,(concat dir-name "/Trash")) + (mu4e-trash-folder . ,(concat dir-name "/Starred")) + (mu4e-refile-folder . ,(concat dir-name "/Archive")) + (smtpmail-smtp-service . ,465) + (smtpmail-smtp-server . ,server) + (mu4e-compose-signature . ,signature))))) + ;;Fixing duplicate UID errors when using mbsync and mu4e + (setq mu4e-change-filenames-when-moving t) + + (setq mu4e-maildir-shortcuts + '(("/Fastmail/Inbox" . ?i) + ("/Fastmail/Sent" . ?s) + ;; ("/Gmail/Trash" . ?t) + ;; ("/Gmail/Drafts" . ?d) + ;; ("/Gmail/[Gmail]/All Mail" . ?a + )) + + (setq mu4e-contexts + `(, (set-mu4e-context + "Fastmail" "Thanos Apollo" + "thanos@thanosapollo.com" "Thanos\nhttps://thanosapollo.com/public" + "smtp.fastmail.com"))) + + ;; (setq smtpmail-smtp-service 465 + ;; smtpmail-stream-type 'ssl + ;; smtpmail-smtp-server "smtp.fastmail.com") + + + + (setq message-send-mail-function 'smtpmail-send-it + smtpmail-stream-type 'ssl)) + #+end_src diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 38e95d9..afba6a2 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -1,8 +1,17 @@ -(when (or (string= (system-name) "fsociety") - (string= (system-name) "heisenberg")) +;; When guix t, load emacs packages +(when (require 'guix t) (add-to-list 'load-path "~/.guix-profile/share/emacs/site-lisp") (guix-emacs-autoload-packages)) +(with-eval-after-load 'geiser-guile + (add-to-list 'geiser-guile-load-path "~/dotfiles/.config/guix")) + +;; Personal Information +(setq user-full-name "Thanos Apollo") +(setq user-mail-address "public@thanosapollo.com") +(setq copyright-names-regexp + (format "%s <%s>" user-full-name user-mail-address)) + (defconst my-package-list '(org-snooze all-the-icons all-the-icons-dired @@ -886,78 +895,66 @@ you have the correctly set the OPENAI_API_KEY variable" :config (setq telega-server-libs-prefix "/opt/homebrew/Cellar/tdlib/HEAD-3d0140b"))) +;; In macOS, load mu4e through homebrew (when (equal system-type 'darwin) (use-package mu4e :load-path "/opt/homebrew/share/emacs/site-lisp/mu/mu4e/")) - -(require 'mu4e) - -(setq mu4e-update-interval (* 10 60)) -(setq mu4e-get-mail-command "mbsync -a") -(setq mu4e-maildir-list "~/Mail/Inbox") - -(defun set-mu4e-context (context-name full-name mail-address signature server) - "Return a mu4e context named CONTEXT-NAME with :match-func matching +;; Check if we have mu4e available +;; if t load mu4e settings +(when (require 'mu4e t) + (setq mu4e-update-interval (* 10 60)) + (setq mu4e-get-mail-command "mbsync -a") + (setq mu4e-maildir-list "~/Mail/Inbox") + + (defun set-mu4e-context (context-name full-name mail-address signature server) + "Return a mu4e context named CONTEXT-NAME with :match-func matching folder name CONTEXT-NAME in Maildir. The context's `user-mail-address', `user-full-name' and `mu4e-compose-signature'`smtpmail-smpt-server' is set to MAIL-ADDRESS FULL-NAME SIGNATURE and SERVER respectively. Special folders are set to context specific folders." - (let ((dir-name (concat "/" context-name))) - (make-mu4e-context - :name context-name - ;; we match based on the maildir of the message - :match-func - `(lambda (msg) - (when msg - (string-match-p - ,(concat "^" dir-name) - (mu4e-message-field msg :maildir)))) - :vars - `((user-mail-address . ,mail-address) - (user-full-name . ,full-name) - (mu4e-sent-folder . ,(concat dir-name "/Sent")) - (mu4e-drafts-folder . ,(concat dir-name "/Drafts")) - (mu4e-trash-folder . ,(concat dir-name "/Trash")) - (mu4e-trash-folder . ,(concat dir-name "/Starred")) - (mu4e-refile-folder . ,(concat dir-name "/Archive")) - (smtpmail-smtp-service . ,465) - (smtpmail-smtp-server . ,server) - (mu4e-compose-signature . ,signature))))) -;;Fixing duplicate UID errors when using mbsync and mu4e -(setq mu4e-change-filenames-when-moving t) - -(setq mu4e-maildir-shortcuts - '(("/Fastmail/Inbox" . ?i) - ("/Fastmail/Sent" . ?s) - ;; ("/Gmail/Trash" . ?t) - ;; ("/Gmail/Drafts" . ?d) - ;; ("/Gmail/[Gmail]/All Mail" . ?a - )) - -(setq mu4e-contexts - `(, (set-mu4e-context - "Fastmail" "Thanos Apollo" - "thanos@thanosapollo.com" "Thanos\nhttps://thanosapollo.com/public" - "smtp.fastmail.com"))) - -;; (setq smtpmail-smtp-service 465 -;; smtpmail-stream-type 'ssl -;; smtpmail-smtp-server "smtp.fastmail.com") - - - -(setq message-send-mail-function 'smtpmail-send-it - smtpmail-stream-type 'ssl) -(custom-set-variables - ;; custom-set-variables was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - '(package-selected-packages - '(dap-mode circe monkeytype ox-gfm doom-themes svg-lib elfeed-goodies org-superstar mastodon dashboard flycheck alsamixer typescript-mode visual-fill-column consult company-box quelpa pdf-tools python-mode json-mode general org-modern which-key popup simple-httpd ef-themes gnu-elpa-keyring-update org-snooze emacsql-sqlite3 exwm-firefox-core lsp-docker all-the-icons-dired rjsx-mode alert toc-org corfu hydra geiser-guile lsp-ui emacsql-sqlite counsel the-matrix-theme helpful multi-vterm all-the-icons-ivy-rich sudo-edit rainbow-delimiters rainbow-identifiers pyvenv geiser-mit paredit org-auto-tangle org-msg eshell-syntax-highlighting doom-modeline use-package magit exwm-mff))) -(custom-set-faces - ;; custom-set-faces was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - ) + (let ((dir-name (concat "/" context-name))) + (make-mu4e-context + :name context-name + ;; we match based on the maildir of the message + :match-func + `(lambda (msg) + (when msg + (string-match-p + ,(concat "^" dir-name) + (mu4e-message-field msg :maildir)))) + :vars + `((user-mail-address . ,mail-address) + (user-full-name . ,full-name) + (mu4e-sent-folder . ,(concat dir-name "/Sent")) + (mu4e-drafts-folder . ,(concat dir-name "/Drafts")) + (mu4e-trash-folder . ,(concat dir-name "/Trash")) + (mu4e-trash-folder . ,(concat dir-name "/Starred")) + (mu4e-refile-folder . ,(concat dir-name "/Archive")) + (smtpmail-smtp-service . ,465) + (smtpmail-smtp-server . ,server) + (mu4e-compose-signature . ,signature))))) + ;;Fixing duplicate UID errors when using mbsync and mu4e + (setq mu4e-change-filenames-when-moving t) + + (setq mu4e-maildir-shortcuts + '(("/Fastmail/Inbox" . ?i) + ("/Fastmail/Sent" . ?s) + ;; ("/Gmail/Trash" . ?t) + ;; ("/Gmail/Drafts" . ?d) + ;; ("/Gmail/[Gmail]/All Mail" . ?a + )) + + (setq mu4e-contexts + `(, (set-mu4e-context + "Fastmail" "Thanos Apollo" + "thanos@thanosapollo.com" "Thanos\nhttps://thanosapollo.com/public" + "smtp.fastmail.com"))) + + ;; (setq smtpmail-smtp-service 465 + ;; smtpmail-stream-type 'ssl + ;; smtpmail-smtp-server "smtp.fastmail.com") + + + + (setq message-send-mail-function 'smtpmail-send-it + smtpmail-stream-type 'ssl)) -- cgit v1.2.3