From 414de370fc61ac9f951c7dfd155d08aa32530c36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Eug=C3=AAnio?= Date: Sun, 22 Jan 2023 02:13:10 -0300 Subject: [PATCH] Add email configuration --- user/email.nix | 46 ++++++++++++++++++++++++++++++++++++++++++++++ user/home.nix | 1 + 2 files changed, 47 insertions(+) create mode 100644 user/email.nix diff --git a/user/email.nix b/user/email.nix new file mode 100644 index 0000000..a7277af --- /dev/null +++ b/user/email.nix @@ -0,0 +1,46 @@ +{ pkgs, ... }: +let + + get_pass = pkgs.writeShellScript "get_pass" '' + pass disroot.org | head -n1 + ''; +in { + accounts.email.accounts = { + "personal" = { + primary = true; + realName = "Leonardo EugĂȘnio"; + address = "lelgenio@disroot.org"; + userName = "lelgenio"; + astroid.enable = true; + imap = { + host = "disroot.org"; + # port = 993; + }; + smtp = { host = "disroot.org"; }; + imapnotify = { + enable = true; + onNotify = "${pkgs.isync}/bin/mbsync -a"; + onNotifyPost = + "${pkgs.notmuch}/bin/notmuch new && ${pkgs.libnotify}/bin/ notify-send 'New mail arrived'"; + }; + mbsync = { + enable = true; + create = "both"; + }; + msmtp.enable = true; + notmuch.enable = true; + passwordCommand = toString get_pass; + }; + }; + + services.imapnotify.enable = true; + + programs.mbsync.enable = true; + services.mbsync.enable = true; + services.mbsync.postExec = "${pkgs.notmuch}/bin/notmuch new"; + programs.notmuch.enable = true; + + programs.msmtp.enable = true; + + programs.astroid.enable = true; +} diff --git a/user/home.nix b/user/home.nix index 74180de..e77c9eb 100644 --- a/user/home.nix +++ b/user/home.nix @@ -19,6 +19,7 @@ in { ./rnnoise.nix ./mimeapps.nix ./chat.nix + ./email.nix ./syncthing.nix ./bmenu.nix ./fzf.nix