summary refs log tree commit diff stats
path: root/user/settings
diff options
context:
space:
mode:
authorAlan Pearce2019-10-09 17:52:28 +0200
committerAlan Pearce2019-10-09 17:53:01 +0200
commit21bdf17d577d87a01e3caaad6b96b58746b51f90 (patch)
treed768b23b0ff302880f8d71843dd20c333ccf844a /user/settings
parent7f06dcd355a37f384589c0f01f7c33de8e00bdca (diff)
downloadnixfiles-21bdf17d577d87a01e3caaad6b96b58746b51f90.tar.lz
nixfiles-21bdf17d577d87a01e3caaad6b96b58746b51f90.tar.zst
nixfiles-21bdf17d577d87a01e3caaad6b96b58746b51f90.zip
Unify mail setup
Diffstat (limited to 'user/settings')
-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
4 files changed, 56 insertions, 10 deletions
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/
   '';