From 1d0fee7cd2aad7033cca9dc376815f81b3f73523 Mon Sep 17 00:00:00 2001 From: Dustin Swan Date: Thu, 28 Nov 2019 22:12:41 -0500 Subject: [PATCH] Getting aerc working. Separating out mail into its own nix file --- home-common.nix | 90 +--------------------------------------- home-linux.nix | 2 +- home-mac.nix | 4 +- home-mail.nix | 106 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 110 insertions(+), 92 deletions(-) create mode 100644 home-mail.nix diff --git a/home-common.nix b/home-common.nix index 7285e1f..9033ed3 100644 --- a/home-common.nix +++ b/home-common.nix @@ -3,7 +3,7 @@ { # nodePackages.eslint home.packages = with pkgs; [ - ripgrep fd wget silver-searcher tree ranger nodejs yarn mosh w3m urlview nmap rtv gnupg youtube-dl nodePackages.tern nodePackages.javascript-typescript-langserver nodePackages.js-beautify nodePackages.prettier ffmpeg ispell aspell aspellDicts.en aspellDicts.en-computers aspellDicts.en-science aspellDicts.fr aspellDicts.de aspellDicts.eo aspellDicts.es hexyl nnn entr httpie cacert + ripgrep fd wget silver-searcher tree ranger nodejs yarn mosh w3m urlview nmap rtv gnupg youtube-dl nodePackages.tern nodePackages.javascript-typescript-langserver nodePackages.js-beautify nodePackages.prettier ffmpeg ispell aspell aspellDicts.en aspellDicts.en-computers aspellDicts.en-science aspellDicts.fr aspellDicts.de aspellDicts.eo aspellDicts.es hexyl nnn entr httpie cacert catimg tldr aerc ]; home.sessionVariables = { @@ -162,94 +162,6 @@ }; }; - accounts.email = { - maildirBasePath = "Mail"; - certificatesFile = "${builtins.getEnv "HOME"}/.nix-profile/etc/ssl/certs/ca-bundle.crt"; - - accounts = { - FastMail = { - address = "dustin@dustinswan.com"; - aliases = "dustinswan@gmail.com"; - realName = "Dustin Swan"; - primary = true; - folders = { - inbox = "INBOX"; - drafts = "INBOX.Drafts"; - sent = "INBOX.Sent"; - trash = "INBOX.Trash"; - }; - userName = "dustinswan@fastmail.com"; - imap.host = "mail.messagingengine.com"; - smtp.host = "mail.messagingengine.com"; - passwordCommand = "gpg -dq ${builtins.getEnv "HOME"}/.dustinswan@fastmail.com-password.gpg"; - offlineimap.enable = true; - msmtp.enable = true; - signature = { - text = '' - Dustin Swan - dustinswan.com - ''; - showSignature = "append"; - }; - }; - - Visionable = { - address = "dswan@visionable.com"; - aliases= "dswan@iocom.com"; - realName = "Dustin Swan"; - folders = { - inbox = "INBOX"; - drafts = "Drafts"; - sent = "Sent Items"; - trash = "Deleted Items"; - }; - userName = "dswan@visionable.com"; - imap.host = "outlook.office365.com"; - smtp.host = "smtp.office365.com"; - passwordCommand = "gpg -dq ${builtins.getEnv "HOME"}/.dswan@visionable.com-password.gpg"; - offlineimap = { - enable = true; - extraConfig.remote = { - folderfilter = ''lambda folder: folder not in [ - 'Calendar', - 'Calendar/Birthdays', - 'Calendar/IOCOM Holidays', - 'Calendar/United States holidays', - 'Contacts', - 'Contacts/Sub Folder 1', - 'Contacts/Sub Folder 2', - 'Contacts/Skype for Business Contacts', - 'Deleted Items', - 'Drafts', - 'Journal', - 'Junk Email', - 'Notes', - 'Outbox', - 'Sync Issues', - 'Sync Issues/Conflicts', - 'Sync Issues/Local Failures', - 'Sync Issues/Server Failures', - 'Tasks', - 'Tasks/Sub Folder 1', - 'Tasks/Sub Folder 2' - ] - ''; - }; - }; - - msmtp.enable = true; - signature = { - text = '' - Dustin Swan, Software Developer - Visionable Ltd | https://visionable.com - dswan@visionable.com - ''; - showSignature = "append"; - }; - }; - }; - }; - programs.msmtp.enable = true; programs.offlineimap.enable = true; diff --git a/home-linux.nix b/home-linux.nix index 9a36372..011f7d7 100644 --- a/home-linux.nix +++ b/home-linux.nix @@ -189,7 +189,7 @@ }; }; - imports = [ ./home-common.nix ]; + imports = [ ./home-common.nix ./home-mail.nix ]; programs.alacritty.settings.font.size = 10.0; } diff --git a/home-mac.nix b/home-mac.nix index 13a1a86..8c0c3f3 100644 --- a/home-mac.nix +++ b/home-mac.nix @@ -1,7 +1,7 @@ { pkgs, lib, ... }: { - home.packages = with pkgs; [ pinentry_mac ]; + home.packages = with pkgs; [ pinentry_mac terminal-notifier ]; home.file.gpg-agent = { target = ".gnupg/gpg-agent.conf"; @@ -14,5 +14,5 @@ programs.zsh.initExtra = "source ~/.nix-profile/etc/profile.d/nix.sh"; - imports = [ ./home-common.nix ]; + imports = [ ./home-common.nix ./home-mail.nix ]; } diff --git a/home-mail.nix b/home-mail.nix new file mode 100644 index 0000000..ed0b299 --- /dev/null +++ b/home-mail.nix @@ -0,0 +1,106 @@ +{ pkgs, ... }: + +{ + home.file.aerc-accounts = { + target = ".config/aerc/accounts.conf"; + # source = ./aerc-accounts.conf; + text = ''[FastMail] +source = maildir://~/Mail/FastMail +from = "Dustin Swan " +outgoing = ${builtins.getEnv "HOME"}/.nix-profile/bin/msmtp --read-envelope-from + +[Visionable] +source = maildir://~/Mail/Visionable +from = "Dustin Swan " +outgoing = ${builtins.getEnv "HOME"}/.nix-profile/bin/msmtp --read-envelope-from''; + executable = false; + }; + + accounts.email = { + maildirBasePath = "Mail"; + certificatesFile = "${builtins.getEnv "HOME"}/.nix-profile/etc/ssl/certs/ca-bundle.crt"; + + accounts = { + FastMail = { + address = "dustin@dustinswan.com"; + aliases = "dustinswan@gmail.com"; + realName = "Dustin Swan"; + primary = true; + folders = { + inbox = "INBOX"; + drafts = "INBOX.Drafts"; + sent = "INBOX.Sent"; + trash = "INBOX.Trash"; + }; + userName = "dustinswan@fastmail.com"; + imap.host = "mail.messagingengine.com"; + smtp.host = "mail.messagingengine.com"; + passwordCommand = "gpg -dq ${builtins.getEnv "HOME"}/.dustinswan@fastmail.com-password.gpg"; + offlineimap.enable = true; + msmtp.enable = true; + signature = { + text = '' + Dustin Swan + dustinswan.com + ''; + showSignature = "append"; + }; + }; + + Visionable = { + address = "dswan@visionable.com"; + aliases= "dswan@iocom.com"; + realName = "Dustin Swan"; + folders = { + inbox = "INBOX"; + drafts = "Drafts"; + sent = "Sent Items"; + trash = "Deleted Items"; + }; + userName = "dswan@visionable.com"; + imap.host = "outlook.office365.com"; + smtp.host = "smtp.office365.com"; + passwordCommand = "gpg -dq ${builtins.getEnv "HOME"}/.dswan@visionable.com-password.gpg"; + offlineimap = { + enable = true; + extraConfig.remote = { + folderfilter = ''lambda folder: folder not in [ + 'Calendar', + 'Calendar/Birthdays', + 'Calendar/IOCOM Holidays', + 'Calendar/United States holidays', + 'Contacts', + 'Contacts/Sub Folder 1', + 'Contacts/Sub Folder 2', + 'Contacts/Skype for Business Contacts', + 'Deleted Items', + 'Drafts', + 'Journal', + 'Junk Email', + 'Notes', + 'Outbox', + 'Sync Issues', + 'Sync Issues/Conflicts', + 'Sync Issues/Local Failures', + 'Sync Issues/Server Failures', + 'Tasks', + 'Tasks/Sub Folder 1', + 'Tasks/Sub Folder 2' + ] + ''; + }; + }; + + msmtp.enable = true; + signature = { + text = '' + Dustin Swan, Software Developer + Visionable Ltd | https://visionable.com + dswan@visionable.com + ''; + showSignature = "append"; + }; + }; + }; + }; +}