diff options
| author | Alejandro Soto <alejandro@34project.org> | 2023-02-11 22:19:37 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2023-02-11 22:33:44 -0600 |
| commit | 0a84e13afc368ceedf08b543de459d163b6c1211 (patch) | |
| tree | 85eed662f4825e14ce60b2eeee76f66cc37bba2f /home/mail | |
| parent | 9596e0e75c6a49083167ef6e2edca9cc448695e1 (diff) | |
home: enable different users on same host
Diffstat (limited to 'home/mail')
| -rw-r--r-- | home/mail/default.nix | 24 |
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" ] '' |
