From 0a84e13afc368ceedf08b543de459d163b6c1211 Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Sat, 11 Feb 2023 22:19:37 -0600 Subject: home: enable different users on same host --- home/mail/default.nix | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'home/mail') 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" ] '' -- cgit v1.2.3