mirror of
https://github.com/willemml/dotfiles.nix.git
synced 2025-04-13 03:37:18 +00:00
remove mu/mu4e email stuff
This commit is contained in:
parent
bab3ebe231
commit
561213dbd3
4 changed files with 0 additions and 159 deletions
|
@ -1,55 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
passCmd = address: "${pkgs.python310Packages.keyring}/bin/keyring get login email(${address})";
|
|
||||||
generalAccount = address: {
|
|
||||||
inherit address;
|
|
||||||
userName = address;
|
|
||||||
mu.enable = true;
|
|
||||||
offlineimap.enable = true;
|
|
||||||
imap.tls = {
|
|
||||||
enable = true;
|
|
||||||
useStartTls = true;
|
|
||||||
};
|
|
||||||
smtp.tls = {
|
|
||||||
enable = true;
|
|
||||||
useStartTls = true;
|
|
||||||
};
|
|
||||||
passwordCommand = passCmd address;
|
|
||||||
};
|
|
||||||
|
|
||||||
gmailAccount = address: ({
|
|
||||||
flavor = "gmail.com";
|
|
||||||
folders = {
|
|
||||||
drafts = "[Gmail].Drafts";
|
|
||||||
inbox = "INBOX";
|
|
||||||
sent = "[Gmail].Sent Mail";
|
|
||||||
trash = "[Gmail].Trash";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
// generalAccount address);
|
|
||||||
in {
|
|
||||||
accounts.email.accounts = {
|
|
||||||
gmail = (gmailAccount "willemleitso@gmail.com") // {realName = "Willem Leitso";};
|
|
||||||
icloud =
|
|
||||||
(pkgs.lib.attrsets.recursiveUpdate
|
|
||||||
{
|
|
||||||
flavor = "plain";
|
|
||||||
imap.host = "imap.mail.me.com";
|
|
||||||
imap.port = 993;
|
|
||||||
smtp.host = "smtp.mail.me.com";
|
|
||||||
smtp.port = 587;
|
|
||||||
}
|
|
||||||
(generalAccount "coalminecraft@icloud.com"))
|
|
||||||
// {folders.inbox = "INBOX";};
|
|
||||||
leitso =
|
|
||||||
(gmailAccount "willem@leit.so")
|
|
||||||
// {
|
|
||||||
primary = true;
|
|
||||||
realName = "Willem Leitso";
|
|
||||||
};
|
|
||||||
wnuke9 = gmailAccount "wnuke9@gmail.com";
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -58,17 +58,6 @@
|
||||||
package = pkgs.jdk;
|
package = pkgs.jdk;
|
||||||
};
|
};
|
||||||
|
|
||||||
mu.enable = true;
|
|
||||||
|
|
||||||
offlineimap = {
|
|
||||||
enable = true;
|
|
||||||
pythonFile = ''
|
|
||||||
import subprocess
|
|
||||||
def get_pass(service, cmd):
|
|
||||||
return subprocess.check_output(cmd, ).splitlines()[0]
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
password-store = {
|
password-store = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.pass.withExtensions (exts: [exts.pass-genphrase exts.pass-otp exts.pass-import]);
|
package = pkgs.pass.withExtensions (exts: [exts.pass-genphrase exts.pass-otp exts.pass-import]);
|
||||||
|
|
|
@ -19,46 +19,6 @@
|
||||||
sha256 = "sha256-6aX2S4cUop1rdxweIF5f1qrgNmYd1mtWgT9T1Q1s2h8=";
|
sha256 = "sha256-6aX2S4cUop1rdxweIF5f1qrgNmYd1mtWgT9T1Q1s2h8=";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
mu4e-accounts = epkgs.trivialBuild {
|
|
||||||
pname = "mu4e-accounts";
|
|
||||||
version = "0.1";
|
|
||||||
buildInputs = [pkgs.mu];
|
|
||||||
src = let
|
|
||||||
smtpConfig = name: (
|
|
||||||
let
|
|
||||||
account = config.accounts.email.accounts.${name};
|
|
||||||
port = builtins.toString account.smtp.port;
|
|
||||||
host = account.smtp.host;
|
|
||||||
in ''
|
|
||||||
("${name}"
|
|
||||||
(mu4e-drafts-folder "/${name}/${account.folders.drafts}")
|
|
||||||
(mu4e-sent-folder "/${name}/${account.folders.sent}")
|
|
||||||
(mu4e-trash-folder "/${name}/${account.folders.trash}")
|
|
||||||
; (mu4e-maildir-shortcuts
|
|
||||||
; '( (:maildir "/${name}/${account.folders.inbox}" :key ?i)
|
|
||||||
; (:maildir "/${name}/${account.folders.sent}" :key ?s)
|
|
||||||
; (:maildir "/${name}/${account.folders.drafts}" :key ?d)
|
|
||||||
; (:maildir "/${name}/${account.folders.trash}" :key ?t)))
|
|
||||||
(smtpmail-default-smtp-server "${host}")
|
|
||||||
(smtpmail-smtp-server "${host}")
|
|
||||||
(smtpmail-smtp-service ${port} )
|
|
||||||
${
|
|
||||||
if account.flavor == "gmail.com"
|
|
||||||
then "(mu4e-sent-messages-behavior 'delete)"
|
|
||||||
else ""
|
|
||||||
}
|
|
||||||
(smtpmail-smtp-user "${account.userName}")
|
|
||||||
(user-mail-address "${account.address}"))
|
|
||||||
''
|
|
||||||
);
|
|
||||||
smtpAccountStrings = pkgs.lib.forEach (builtins.attrNames config.accounts.email.accounts) (account: " ${(smtpConfig account)} ");
|
|
||||||
smtpAccounts = "'( ${pkgs.lib.concatStrings smtpAccountStrings} )";
|
|
||||||
in
|
|
||||||
pkgs.writeText "mu4e-accounts.el" ''
|
|
||||||
(defvar my-mu4e-account-alist ${smtpAccounts} )
|
|
||||||
(provide 'mu4e-accounts)
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
org-auctex = epkgs.trivialBuild rec {
|
org-auctex = epkgs.trivialBuild rec {
|
||||||
pname = "org-auctex";
|
pname = "org-auctex";
|
||||||
version = "e1271557b9f36ca94cabcbac816748e7d0dc989c";
|
version = "e1271557b9f36ca94cabcbac816748e7d0dc989c";
|
||||||
|
@ -115,8 +75,6 @@
|
||||||
magit
|
magit
|
||||||
magit-section
|
magit-section
|
||||||
meow
|
meow
|
||||||
mu4e
|
|
||||||
mu4e-accounts
|
|
||||||
nix-mode
|
nix-mode
|
||||||
nix-update
|
nix-update
|
||||||
org
|
org
|
||||||
|
|
|
@ -77,8 +77,6 @@
|
||||||
(require 'lean4-mode)
|
(require 'lean4-mode)
|
||||||
(require 'magit)
|
(require 'magit)
|
||||||
(require 'meow)
|
(require 'meow)
|
||||||
(require 'mu4e)
|
|
||||||
(require 'mu4e-accounts)
|
|
||||||
(require 'nix-mode)
|
(require 'nix-mode)
|
||||||
(require 'nix-update)
|
(require 'nix-update)
|
||||||
(require 'ob-dot)
|
(require 'ob-dot)
|
||||||
|
@ -103,7 +101,6 @@
|
||||||
(require 'polymode)
|
(require 'polymode)
|
||||||
(require 'rustic)
|
(require 'rustic)
|
||||||
(require 'rust-ts-mode)
|
(require 'rust-ts-mode)
|
||||||
(require 'smtpmail-async)
|
|
||||||
(require 'swiper)
|
(require 'swiper)
|
||||||
(require 'tex)
|
(require 'tex)
|
||||||
(require 'yasnippet)
|
(require 'yasnippet)
|
||||||
|
@ -264,54 +261,6 @@
|
||||||
(meow-global-mode 1)
|
(meow-global-mode 1)
|
||||||
|
|
||||||
|
|
||||||
;; Configure mu4e
|
|
||||||
|
|
||||||
;; Setup sending email with mu4e
|
|
||||||
(setq send-mail-function 'smtpmail-send-it
|
|
||||||
message-send-mail-function 'smtpmail-send-it)
|
|
||||||
|
|
||||||
(add-hook 'mu4e-compose-pre-hook 'my-mu4e-set-account)
|
|
||||||
|
|
||||||
(defvar starttls-use-gnutls t)
|
|
||||||
(setq message-kill-buffer-on-exit t
|
|
||||||
mail-user-agent 'mu4e-user-agent)
|
|
||||||
|
|
||||||
|
|
||||||
(define-key mu4e-main-mode-map (kbd "C-c C-u") 'my-mu4e-set-account)
|
|
||||||
|
|
||||||
|
|
||||||
(set-variable 'read-mail-command 'mu4e)
|
|
||||||
|
|
||||||
(mapc #'(lambda (var)
|
|
||||||
(set (car var) (cadr var)))
|
|
||||||
(cdr (assoc "leitso" my-mu4e-account-alist)))
|
|
||||||
|
|
||||||
(defun my-mu4e-set-account ()
|
|
||||||
"Set the account for composing a message."
|
|
||||||
(let* ((account
|
|
||||||
(if mu4e-compose-parent-message
|
|
||||||
(let ((maildir (mu4e-message-field mu4e-compose-parent-message :maildir)))
|
|
||||||
(string-match "/\\(.*?\\)/" maildir)
|
|
||||||
(match-string 1 maildir))
|
|
||||||
(completing-read (format "Compose with account: (%s) "
|
|
||||||
(mapconcat #'(lambda (var) (car var))
|
|
||||||
my-mu4e-account-alist "/"))
|
|
||||||
(mapcar #'(lambda (var) (car var)) my-mu4e-account-alist)
|
|
||||||
nil t nil nil (caar my-mu4e-account-alist))))
|
|
||||||
(account-vars (cdr (assoc account my-mu4e-account-alist))))
|
|
||||||
(if account-vars
|
|
||||||
(mapc #'(lambda (var)
|
|
||||||
(set (car var) (cadr var)))
|
|
||||||
account-vars)
|
|
||||||
(error "No email account found"))))
|
|
||||||
|
|
||||||
(setq mu4e-bookmarks
|
|
||||||
'((:name "Unread messages" :query "flag:unread AND NOT (flag:trashed OR maildir:/feeds)" :key ?u)
|
|
||||||
(:name "Today's messages" :query "date:today..now AND NOT maildir:/feeds" :key ?t)
|
|
||||||
(:name "Last 7 days" :query "date:7d..now AND NOT maildir:/feeds" :key ?w)
|
|
||||||
(:name "Feed" :query "maildir:/feeds" :key ?f)
|
|
||||||
(:name "XKCD" :query "list:xkcd.localhost" :key ?x)))
|
|
||||||
|
|
||||||
;; Polymode config (add support for nix files with commented strings)
|
;; Polymode config (add support for nix files with commented strings)
|
||||||
|
|
||||||
(define-hostmode poly-nix-hostmode :mode 'nix-mode)
|
(define-hostmode poly-nix-hostmode :mode 'nix-mode)
|
||||||
|
|
Loading…
Add table
Reference in a new issue