summary refs log tree commit diff stats
path: root/user
diff options
context:
space:
mode:
Diffstat (limited to 'user')
-rw-r--r--user/emacs/.emacs.d/init.el14
-rw-r--r--user/isync/.mbsyncrc37
-rw-r--r--user/msmtp/.msmtprc17
-rw-r--r--user/satoshipad.nix5
-rw-r--r--user/settings/isync.nix5
-rw-r--r--user/settings/mail.nix25
-rw-r--r--user/settings/msmtp.nix5
-rw-r--r--user/settings/satoshipay.nix31
8 files changed, 66 insertions, 73 deletions
diff --git a/user/emacs/.emacs.d/init.el b/user/emacs/.emacs.d/init.el
index 5c30ce82..a6ff1f6c 100644
--- a/user/emacs/.emacs.d/init.el
+++ b/user/emacs/.emacs.d/init.el
@@ -812,14 +812,14 @@ _p_rev       _u_pper              _=_: upper/lower       _r_esolve
                                                   (string-equal (system-name) "satoshipad")))
                                   :vars '((user-mail-address . "alan@satoshipay.io")
                                           (mu4e-sent-messages-behavior . delete)
-                                          (mu4e-drafts-folder . "/satoshipay/Drafts")
-                                          (mu4e-sent-folder . "/satoshipay/Sent Mail")
-                                          (mu4e-refile-folder . "/satoshipay/All Mail")
-                                          (mu4e-trash-folder . "/satoshipay/Bin")
+                                          (mu4e-drafts-folder . "/satoshipay/[Gmail]/Drafts")
+                                          (mu4e-sent-folder . "/satoshipay/[Gmail]/Sent Mail")
+                                          (mu4e-refile-folder . "/satoshipay/[Gmail]/All Mail")
+                                          (mu4e-trash-folder . "/satoshipay/[Gmail]/Bin")
                                           (mu4e-maildir-shortcuts . (("/satoshipay/INBOX" . ?i)
-                                                                     ("/satoshipay/All Mail" . ?a)
-                                                                     ("/satoshipay/Sent Mail" . ?s)
-                                                                     ("/satoshipay/Spam" . ?p)))))))))
+                                                                     ("/satoshipay/[Gmail]/All Mail" . ?a)
+                                                                     ("/satoshipay/[Gmail]/Sent Mail" . ?s)
+                                                                     ("/satoshipay/[Gmail]/Spam" . ?p)))))))))
 
 ;;; Take me to my leader
 
diff --git a/user/isync/.mbsyncrc b/user/isync/.mbsyncrc
deleted file mode 100644
index 396bc6a6..00000000
--- a/user/isync/.mbsyncrc
+++ /dev/null
@@ -1,37 +0,0 @@
-# Globals
-Create Both
-Remove Both
-Expunge Both
-CopyArrivalDate yes
-FSync no
-
-## Satoshipay
-# Account
-IMAPAccount satoshipay.io
-Host imap.gmail.com
-User alan@satoshipay.io
-PassCmd "keyring get satoshipay-google-mail alan@satoshipay.io"
-SSLType IMAPS
-SSLVersions TLSv1.2 TLSv1.1
-
-# Remote
-IMAPStore satoshipay.io-remote
-Account satoshipay.io
-
-# Local
-MaildirStore satoshipay.io-local
-Path ~/mail/satoshipay/
-Inbox ~/mail/satoshipay/INBOX
-SubFolders Verbatim
-
-# Job
-Channel satoshipay
-Master :satoshipay.io-remote:
-Slave :satoshipay.io-local:
-Patterns INBOX
-SyncState *
-
-Channel satoshipay-gmail
-Master :satoshipay.io-remote:[Gmail]/
-Slave :satoshipay.io-local:
-Patterns * !INBOX
\ No newline at end of file
diff --git a/user/msmtp/.msmtprc b/user/msmtp/.msmtprc
deleted file mode 100644
index da5c5daf..00000000
--- a/user/msmtp/.msmtprc
+++ /dev/null
@@ -1,17 +0,0 @@
-# Set default values for all following accounts.
-defaults
-auth           on
-tls            on
-tls_trust_file /etc/ssl/certs/ca-certificates.crt
-logfile        ~/.local/log/msmtp.log
-
-account        satoshipay
-host           smtp.gmail.com
-from           alan@satoshipay.io
-user           alan@satoshipay.io
-port           465
-tls_starttls   off
-passwordeval   keyring get satoshipay-google-mail alan@satoshipay.io
-
-# Set a default account
-account default : satoshipay
diff --git a/user/satoshipad.nix b/user/satoshipad.nix
index 3dda7bd1..d5f404c6 100644
--- a/user/satoshipad.nix
+++ b/user/satoshipad.nix
@@ -10,9 +10,8 @@
     ./settings/git.nix
     ./settings/gnupg.nix
     ./settings/i3.nix
-    ./settings/isync.nix
     ./settings/javascript.nix
-    ./settings/msmtp.nix
+    ./settings/mail.nix
     ./settings/nixos.nix
     ./settings/rofi.nix
     ./settings/passwords.nix
@@ -25,6 +24,8 @@
     ./settings/zsh.nix
   ];
 
+  accounts.email.accounts.satoshipay.primary = true;
+
   xsession.windowManager.i3 = {
     config = {
       assigns = {
diff --git a/user/settings/isync.nix b/user/settings/isync.nix
deleted file mode 100644
index b96db87d..00000000
--- a/user/settings/isync.nix
+++ /dev/null
@@ -1,5 +0,0 @@
-{ config, pkgs, ... }:
-
-{
-  home.file.".mbsyncrc".source = ../isync/.mbsyncrc;
-}
diff --git a/user/settings/mail.nix b/user/settings/mail.nix
new file mode 100644
index 00000000..3ce9e548
--- /dev/null
+++ b/user/settings/mail.nix
@@ -0,0 +1,25 @@
+{ config, pkgs, ... }:
+
+{
+  home.packages = [
+    pkgs.html2text
+  ];
+  accounts.email = {
+    maildirBasePath = "mail";
+  };
+  programs.mbsync = {
+    enable = true;
+    extraConfig = ''
+      CopyArrivalDate yes
+      FSync no
+    '';
+  };
+  services.mbsync = {
+    enable = true;
+    frequency = "*:6/15";
+    postExec = "${config.programs.emacs.finalPackage}/bin/emacsclient -e (mu4e-update-index)";
+  };
+  programs.msmtp = {
+    enable = true;
+  };
+}
diff --git a/user/settings/msmtp.nix b/user/settings/msmtp.nix
deleted file mode 100644
index 45c2f460..00000000
--- a/user/settings/msmtp.nix
+++ /dev/null
@@ -1,5 +0,0 @@
-{ config, pkgs, ... }:
-
-{
-  home.file.".msmtprc".source = ../msmtp/.msmtprc;
-}
diff --git a/user/settings/satoshipay.nix b/user/settings/satoshipay.nix
index 6516bd59..822f6b6f 100644
--- a/user/settings/satoshipay.nix
+++ b/user/settings/satoshipay.nix
@@ -49,6 +49,37 @@ in
     }
   ];
 
+  accounts.email.accounts.satoshipay = let
+    address = "alan@satoshipay.io";
+  in
+  {
+    inherit address;
+    realName = "Alan Pearce";
+    flavor = "gmail.com";
+    passwordCommand = "${pkgs.python3Packages.keyring}/bin/keyring get satoshipay-google-mail ${address}";
+    folders = {
+      inbox = "INBOX";
+      drafts = "[Gmail]/Drafts";
+      sent = "[Gmail]/Sent Mail";
+      trash = "[Gmail]/Bin";
+    };
+    imap = {
+      tls.enable = true;
+    };
+    smtp = {
+      tls.enable = true;
+    };
+    mbsync = {
+      enable = true;
+      create = "maildir";
+      remove = "maildir";
+      expunge = "both";
+    };
+    msmtp = {
+      enable = true;
+    };
+  };
+
   home.file.".npmrc".text = ''
     @satoshipay:registry=https://registry.npmjs.org/
   '';