diff options
author | Baitinq <manuelpalenzuelamerino@gmail.com> | 2022-09-27 01:34:39 +0200 |
---|---|---|
committer | Baitinq <manuelpalenzuelamerino@gmail.com> | 2022-09-29 13:45:35 +0200 |
commit | 8dbcb421c1bb644a913ffa5f32d4b338a82ced11 (patch) | |
tree | 899e4501af8943d7597cfe7e21e3b5d485be0e38 | |
parent | Overlays: Base: Grub2: Support luks2 with patch (diff) | |
download | nixos-config-8dbcb421c1bb644a913ffa5f32d4b338a82ced11.tar.gz nixos-config-8dbcb421c1bb644a913ffa5f32d4b338a82ced11.tar.bz2 nixos-config-8dbcb421c1bb644a913ffa5f32d4b338a82ced11.zip |
Modules: Add email module
-rw-r--r-- | hosts/home.nix | 4 | ||||
-rw-r--r-- | modules/email/default.nix | 75 |
2 files changed, 78 insertions, 1 deletions
diff --git a/hosts/home.nix b/hosts/home.nix index 8bc2ad0..818a0a6 100644 --- a/hosts/home.nix +++ b/hosts/home.nix @@ -1,6 +1,8 @@ { config, lib, pkgs, inputs, user, hostname, secrets, dotfiles, location, ... }: { - imports = [ ]; + imports = [ + ../modules/email + ]; home = { username = "${user}"; diff --git a/modules/email/default.nix b/modules/email/default.nix new file mode 100644 index 0000000..ba4e23b --- /dev/null +++ b/modules/email/default.nix @@ -0,0 +1,75 @@ +{ config, pkgs, lib, secrets, ... }: +{ + services = { + mbsync.enable = true; + imapnotify.enable = false; + }; + + programs = { + mbsync.enable = true; + msmtp.enable = true; + notmuch.enable = true; + neomutt = { + enable = true; + sidebar.enable = true; + vimKeys = true; + sort = "reverse-date"; + }; + }; + + accounts.email = { + maildirBasePath = "Mail"; + accounts = { + "manuelpalenzuelamerino@gmail.com" = { + primary = true; + flavor = "gmail.com"; + + realName = "Manuel Palenzuela Merino"; + signature = { + showSignature = "none"; + text = '' + Manuel Palenzuela Merino + ''; + }; + + address = "manuelpalenzuelamerino@gmail.com"; + userName = "manuelpalenzuelamerino@gmail.com"; + + imapnotify = { + enable = true; + boxes = [ "Inbox" ]; + onNotifyPost = { + mail = '' + ${pkgs.notmuch}/bin/notmuch new && ${pkgs.libnotify}/bin/notify-send "New mail arrived." + ''; + }; + }; + msmtp.enable = true; + notmuch.enable = true; + mbsync = { + enable = true; + create = "both"; + }; + neomutt = { + enable = true; + /*extraConfig = '' + set imap_user = 'manuelpalenzuelamerino@gmail.com' + set imap_pass = '${secrets.git.email.password}' + set spoolfile = imaps://imap.gmail.com/INBOX + set folder = imaps://imap.gmail.com/ + set record="imaps://imap.gmail.com/[Gmail]/Sent Mail" + set postponed="imaps://imap.gmail.com/[Gmail]/Drafts" + set mbox="imaps://imap.gmail.com/[Gmail]/All Mail" + + # ================ SMTP ==================== + set smtp_url = "smtp://manuelpalenzuelamerino@smtp.gmail.com:587/" + set smtp_pass = ${secrets.git.email.password} + set ssl_force_tls = yes # Require encrypted connection + '';*/ + }; + passwordCommand = "${pkgs.coreutils}/bin/echo ${secrets.git.email.password}"; + }; + }; + }; +} + |