{ pkgs, secrets, ... }: { programs.mbsync.enable = true; programs.msmtp.enable = true; services.mbsync.enable = true; home.file.".config/aerc/stylesets" = let catppuccin-aerc = pkgs.fetchFromGitHub { owner = "catppuccin"; repo = "aerc"; rev = "ca404a9f2d125ef12db40db663d43c9d94116a05"; hash = "sha256-OWIkHsKFts/zkrDUtbBPXHVSrHL/F0v3LB1rnlFAKmE="; }; in { source = "${catppuccin-aerc}/dist"; recursive = true; }; programs.aerc = { enable = true; extraBinds = { global = { "" = ":prev-tab"; "" = ":next-tab"; "?" = ":help keys"; }; messages = { "h" = ":prev-tab"; "l" = ":next-tab"; "j" = ":next"; "" = ":next"; "" = ":next 50%"; "" = ":next 100%"; "" = ":next 100%"; "k" = ":prev"; "" = ":prev"; "" = ":prev 50%"; "" = ":prev 100%"; "" = ":prev 100%"; "g" = ":select 0"; "G" = ":select -1"; "J" = ":next-folder"; "K" = ":prev-folder"; "H" = ":collapse-folder"; "L" = ":expand-folder"; "v" = ":mark -t"; "x" = ":mark -t:next"; "V" = ":mark -v"; "T" = ":toggle-threads"; "" = ":view"; "d" = ":prompt 'Really delete this message?' 'delete-message'"; "D" = ":delete"; "A" = ":archive flat"; "C" = ":compose"; "rr" = ":reply -a"; "rq" = ":reply -aq"; "Rr" = ":reply"; "Rq" = ":reply -q"; "c" = ":cf"; "$" = ":term"; "!" = ":term"; "|" = ":pipe"; "/" = ":search"; "\\" = ":filter"; "n" = ":next-result"; "N" = ":prev-result"; "" = ":clear"; }; "messages:folder=Drafts" = { "" = ":recall"; }; view = { "/" = ":toggle-key-passthrough/"; "q" = ":close"; "O" = ":open"; "S" = ":save"; "|" = ":pipe"; "D" = ":delete"; "A" = ":archive flat"; "" = ":open-link "; "f" = ":forward"; "rr" = ":reply -a"; "rq" = ":reply -aq"; "Rr" = ":reply"; "Rq" = ":reply -q"; "H" = ":toggle-headers"; "" = ":prev-part"; "" = ":next-part"; "J" = ":next"; "K" = ":prev"; }; "view::passthrough" = { "$noinherit" = true; "$ex" = ""; "" = ":toggle-key-passthrough"; }; compose = { "$noinherit" = "true"; "$ex" = ""; "" = ":prev-field"; "" = ":next-field"; "" = ":switch-account -p"; "" = ":switch-account -n"; "" = ":next-field"; "" = ":prev-tab"; "" = ":next-tab"; }; "compose::editor" = { "$noinherit" = "true"; "$ex" = ""; "" = ":prev-field"; "" = ":next-field"; "" = ":prev-tab"; "" = ":next-tab"; }; "compose::review" = { "y" = ":send"; "n" = ":abort"; "p" = ":postpone"; "q" = ":choose -o d discard abort -o p postpone postpone"; "e" = ":edit"; "a" = ":attach"; "d" = ":detach"; }; terminal = { "$noinherit" = "true"; "$ex" = ""; "" = ":prev-tab"; "" = ":next-tab"; }; }; extraConfig = { general.unsafe-accounts-conf = true; ui = { styleset-name = "catppuccin-mocha"; this-day-time-format = ''" 15:04"''; this-year-time-format = "Mon Jan 02 15:04"; timestamp-format = "2006-01-02 15:04"; spinner = "[ ⡿ ],[ ⣟ ],[ ⣯ ],[ ⣷ ],[ ⣾ ],[ ⣽ ],[ ⣻ ],[ ⢿ ]"; border-char-vertical = "┃"; border-char-horizontal = "━"; }; viewer = { always-show-mime = true; }; compose = { no-attachment-warning = "^[^>]*attach(ed|ment)"; }; triggers = { email-received = ''exec notify-send "New email from %n" "%s"''; }; filters = { "text/plain" = "colorize"; "text/html" = "html"; "text/calendar" = "calendar"; "message/delivery-status" = "colorize"; "message/rfc822" = "colorize"; "image/*" = "${pkgs.catimg}/bin/catimg -"; }; }; }; accounts.email = { accounts.autistici = { aerc.enable = true; address = "andrea.ciceri@autistici.org"; gpg = { key = "7A66EEA1E6C598D07D361287A1FC89532D1C565"; signByDefault = true; }; imap = { host = "mail.autistici.org"; port = 993; }; mbsync = { enable = true; create = "maildir"; }; msmtp.enable = true; notmuch.enable = true; primary = true; realName = "Andrea Ciceri"; signature = { text = '' Andrea Ciceri ''; showSignature = "append"; }; passwordCommand = "${pkgs.coreutils}/bin/cat ${secrets.autistici-password.path}"; smtp = { host = "smtp.autistici.org"; }; userName = "andrea.ciceri@autistici.org"; }; accounts.mlabs = { address = "andreaciceri@mlabs.city"; imap = { host = "imap.gmail.com"; port = 993; }; realName = "Andrea Ciceri"; smtp.host = "smtp.gmail.com"; userName = "andreaciceri@mlabs.city"; }; }; }