commit 9221d41b100a950404281dac3e5d23dc05e158ed parent ce4684c33eb5f8dd8e2986b643a15a8e71dbcfdf Author: Vincent Demeester <vincent@sbr.pm> Date: Fri, 22 Feb 2019 20:08:08 +0100 modules: add email module Signed-off-by: Vincent Demeester <vincent@sbr.pm> Diffstat:
M | modules/module-list.nix | | | 1 | + |
A | modules/profiles/mails.nix | | | 74 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
2 files changed, 75 insertions(+), 0 deletions(-)
diff --git a/modules/module-list.nix b/modules/module-list.nix @@ -20,6 +20,7 @@ ./profiles/i3.nix ./profiles/kubernetes.nix ./profiles/laptop.nix + ./profiles/mails.nix ./profiles/media.nix ./profiles/openshift.nix ./profiles/ssh.nix diff --git a/modules/profiles/mails.nix b/modules/profiles/mails.nix @@ -0,0 +1,74 @@ +{ config, lib, ... }: + +with lib; +let + cfg = config.profiles.mails; +in +{ + options = { + profiles.mails = { + enable = mkOption { + default = true; + description = "Enable mails configurations"; + type = types.bool; + }; + }; + }; + config = mkIf cfg.enable { + accounts.email = { + maildirBasePath = "desktop/mails"; + accounts = { + "redhat" = { + address = "vdemeest@redhat.com"; + userName = "vdemeest@redhat.com"; + realName = "Vincent Demeester"; + passwordCommand = "gpg -q --for-your-eyes-only --no-tty --exit-on-status-write-error --batch --passphrase-file ~/sync/rh.pass -d ~/desktop/documents/rh.pass.gpg"; + imap.host = "imap.gmail.com"; + smtp.host = "smtp.gmail.com"; + mbsync = { + enable = true; + create = "both"; + #expunge = "both"; + patterns = ["*" "![Gmail]*" "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/All Mail"]; + extraConfig = { + channel = { + Sync = "All"; + }; + }; + }; + notmuch.enable = true; + astroid.enable = true; + msmtp.enable = true; + }; + "perso" = { + primary = true; + address = "vinc.demeester@gmail.com"; + userName = "vinc.demeester@gmail.com"; + realName = "Vincent Demeester"; + passwordCommand = "gpg -q --for-your-eyes-only --no-tty --exit-on-status-write-error --batch --passphrase-file ~/sync/perso.pass -d ~/desktop/documents/perso.pass.gpg"; + imap.host = "imap.gmail.com"; + smtp.host = "smtp.gmail.com"; + mbsync = { + enable = true; + create = "both"; + #expunge = "both"; + patterns = ["*" "![Gmail]*" "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/All Mail"]; + extraConfig = { + channel = { + Sync = "All"; + }; + }; + }; + notmuch.enable = true; + astroid.enable = true; + msmtp.enable = true; + }; + }; + }; + services.mbsync.enable = true; + programs.mbsync.enable = true; + programs.afew.enable = true; + programs.notmuch.enable = true; + programs.msmtp.enable = true; + }; +}