summaryrefslogtreecommitdiff
path: root/home/mail
diff options
context:
space:
mode:
Diffstat (limited to 'home/mail')
-rw-r--r--home/mail/default.nix24
1 files changed, 18 insertions, 6 deletions
diff --git a/home/mail/default.nix b/home/mail/default.nix
index a6fe8ff..c858c29 100644
--- a/home/mail/default.nix
+++ b/home/mail/default.nix
@@ -1,13 +1,25 @@
{ config, lib, pkgs, ... }:
with lib; {
+ options.local.mail = with types; {
+ address = mkOption {
+ type = str;
+ };
+
+ realName = mkOption {
+ type = str;
+ };
+
+ sieve.enable = mkEnableOption "sieve filter";
+ };
+
config = mkIf (!config.home.isolation.active) {
accounts.email = {
maildirBasePath = "mail";
accounts.local = {
- address = "alejandro@34project.org";
- userName = "alejandro@34project.org";
- realName = "Alejandro Soto";
+ address = "${config.local.mail.address}@34project.org";
+ userName = "${config.local.mail.address}@34project.org";
+ inherit (config.local.mail) realName;
primary = true;
@@ -37,8 +49,8 @@ with lib; {
vimKeys = true;
settings = {
- record = "+.Sent";
- postponed = "+.Drafts";
+ record = "+.sent";
+ postponed = "+.drafts";
use_threads = "flat";
index_format = "'%4C %Z %<[y?%<[m?%<[d?%[%H:%M ]&%[%a %d]>&%[%b %d]>&%[%m/%y ]> %-15.15L (%?l?%4l&%4c?) %s'";
@@ -60,7 +72,7 @@ with lib; {
find $out -name '*.sieve' -exec ${pkgs.dovecot_pigeonhole}/bin/sievec -c /dev/null {} \;
'';
in
- {
+ mkIf config.local.mail.sieve.enable {
file."sieve".source = sieve;
activation.sieve = hm.dag.entryBetween [ "linkGeneration" ] [ "writeBoundary" ] ''