about summary refs log tree commit diff
path: root/home/mail/accounts/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'home/mail/accounts/default.nix')
-rw-r--r--home/mail/accounts/default.nix93
1 files changed, 0 insertions, 93 deletions
diff --git a/home/mail/accounts/default.nix b/home/mail/accounts/default.nix
deleted file mode 100644
index de735b5..0000000
--- a/home/mail/accounts/default.nix
+++ /dev/null
@@ -1,93 +0,0 @@
-{ config, lib, pkgs, self, ... }:
-let cfg = config.my.home.mail;
-in
-{
-  config = lib.mkIf cfg.enable {
-    # to replace the secret go to
-    # https://app.fastmail.com/settings/security/devicekeys
-    homeage.file."fastmail-imap" = {
-      source = "${self}/home/secrets/fastmail/imap.age";
-    };
-
-    accounts.email = {
-      accounts = {
-        Fastmail = rec {
-          primary = true;
-          address = "franck@fcuny.net";
-          userName = address;
-          realName = "Franck Cuny";
-          aliases = [ "franck.cuny@gmail.com" ];
-          passwordCommand = "${pkgs.coreutils}/bin/cat '${config.homeage.mount}/fastmail-imap'";
-          imap.host = "imap.fastmail.com";
-          smtp.host = "smtp.fastmail.com";
-          mbsync = {
-            enable = true;
-            create = "maildir";
-            expunge = "both";
-            extraConfig.channel.CopyArrivalDate = "yes";
-          };
-          msmtp.enable = true;
-          notmuch.enable = true;
-        };
-      };
-    };
-
-    programs.mbsync.enable = true;
-    programs.msmtp.enable = true;
-
-    programs.afew = {
-      enable = true;
-      extraConfig = ''
-        [SpamFilter]
-        [KillThreadsFilter]
-        [ArchiveSentMailsFilter]
-
-        [FolderNameFilter]
-        maildir_separator = /
-        folder_transforms = Archive:archive Drafts:draft Sent:sent
-        folder_lowercases = true
-
-        [MailMover]
-        folders = Fastmail/Inbox
-        rename = True
-        max_age = 30
-
-        # rules
-        Fastmail/Inbox = 'tag:archive':Fastmail/Archive
-      '';
-    };
-
-    programs.notmuch = {
-      enable = true;
-      maildir.synchronizeFlags = true;
-      new.tags = [ "unread" "new" ];
-      new.ignore = [ "Trash" ];
-      search.excludeTags = [ "spam" "deleted" ];
-      hooks = {
-        postNew = "${config.home.profileDirectory}/bin/afew -v --tag --new --notmuch-config=${config.xdg.configHome}/notmuch/default/config";
-      };
-    };
-
-    systemd.user.services.mbsync = {
-      Unit = { Description = "mbsync synchronization"; };
-      Service = {
-        Type = "oneshot";
-        ExecStartPre = [
-          "${pkgs.notmuch}/bin/notmuch tag '-inbox' 'tag:inbox AND tag:archive'"
-          "${pkgs.afew}/bin/afew -m -v --notmuch-config=${config.xdg.configHome}/notmuch/default/config"
-        ];
-        ExecStart = "${pkgs.isync}/bin/mbsync -a";
-        ExecStartPost = "${pkgs.notmuch}/bin/notmuch new --quiet";
-      };
-    };
-
-    systemd.user.timers.mbsync = {
-      Unit = { Description = "mbsync synchronization"; };
-      Timer = {
-        OnBootSec = "30";
-        OnUnitActiveSec = "5m";
-      };
-      Install = { WantedBy = [ "timers.target" ]; };
-    };
-  };
-}