Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 1 | { pkgs |
| 2 | , config |
| 3 | , username |
| 4 | , home-manager-unstable |
| 5 | , home |
| 6 | , lib |
| 7 | , ... |
Skyler Grey | 8753c52 | 2022-09-02 00:04:02 +0100 | [diff] [blame] | 8 | }: { |
| 9 | home = { |
Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 10 | imports = [ "${home-manager-unstable}/modules/programs/aerc.nix" ]; |
Skyler Grey | 8753c52 | 2022-09-02 00:04:02 +0100 | [diff] [blame] | 11 | accounts.email = { |
| 12 | maildirBasePath = "Mail"; |
| 13 | accounts = { |
| 14 | collabora = { |
| 15 | astroid = { |
| 16 | enable = true; |
| 17 | sendMailCommand = "${pkgs.msmtp}/bin/msmtpq --read-envelope-from --read-recipients"; |
| 18 | }; |
| 19 | msmtp.enable = true; |
| 20 | aerc = { |
| 21 | enable = true; |
| 22 | extraAccounts = { |
| 23 | source = "notmuch://~/${home.accounts.email.maildirBasePath}/collabora"; |
| 24 | }; |
| 25 | }; |
| 26 | himalaya.enable = true; |
| 27 | neomutt.enable = true; |
| 28 | mbsync = { |
| 29 | enable = true; |
| 30 | create = "maildir"; |
| 31 | }; |
| 32 | notmuch.enable = true; |
| 33 | address = "skyler.grey@collabora.com"; |
| 34 | imap = { |
| 35 | host = "mail.collabora.com"; |
| 36 | port = 143; |
| 37 | tls.useStartTls = true; |
| 38 | }; |
| 39 | smtp = { |
| 40 | host = "mail.collabora.com"; |
| 41 | port = 587; |
| 42 | tls.useStartTls = true; |
| 43 | }; |
| 44 | userName = "skyler"; |
| 45 | realName = "Skyler Grey"; |
| 46 | primary = true; |
| 47 | signature = { |
| 48 | showSignature = "append"; |
| 49 | text = '' |
| 50 | Miss Skyler Grey |
| 51 | Intern |
| 52 | |
| 53 | Collabora Ltd. |
| 54 | Platinum Building, St John's Innovation Park, Cambridge CB4 0DS, UK |
| 55 | Registered in England & Wales, no. 5513718''; |
| 56 | }; |
| 57 | passwordCommand = "${pkgs.coreutils}/bin/cat ${config.sops.secrets.collaboraPassword.path}"; |
| 58 | }; |
| 59 | }; |
| 60 | }; |
| 61 | programs.astroid.enable = true; |
| 62 | programs.msmtp.enable = true; |
| 63 | services.mbsync = { |
| 64 | enable = true; |
| 65 | postExec = "${pkgs.notmuch}/bin/notmuch new"; |
| 66 | }; |
| 67 | programs.mbsync.enable = true; |
| 68 | programs.himalaya.enable = true; |
| 69 | programs.neomutt = { |
| 70 | enable = true; |
| 71 | sidebar.enable = true; |
| 72 | settings = { |
| 73 | preferred_languages = "en"; |
| 74 | }; |
| 75 | extraConfig = '' |
| 76 | auto_view text/html |
| 77 | ''; |
| 78 | }; |
| 79 | programs.notmuch.enable = true; |
| 80 | programs.aerc = { |
| 81 | enable = true; |
| 82 | extraConfig.general.unsafe-accounts-conf = true; |
Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 83 | extraBinds = lib.pipe ./email/aerc-default-binds.toml [ builtins.readFile builtins.fromTOML ]; |
| 84 | extraConfig.filters = |
| 85 | let |
| 86 | defaultFilters = lib.pipe "${pkgs.aerc}/share/aerc/filters" [ |
| 87 | builtins.readDir |
| 88 | builtins.attrNames |
| 89 | (builtins.map (f: { |
| 90 | name = f; |
| 91 | value = "${pkgs.aerc}/share/aerc/filters/${f}"; |
| 92 | })) |
| 93 | builtins.listToAttrs |
| 94 | ]; |
| 95 | in |
Skyler Grey | a9addb3 | 2022-10-31 00:22:55 +0000 | [diff] [blame] | 96 | with defaultFilters; { |
| 97 | "text/plain" = colorize; |
| 98 | "text/calendar" = defaultFilters."show-ics-details.py"; |
| 99 | "text/html" = html; |
| 100 | }; |
Skyler Grey | 8753c52 | 2022-09-02 00:04:02 +0100 | [diff] [blame] | 101 | }; |
Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 102 | home.packages = with pkgs; [ lynx ]; |
Skyler Grey | 8753c52 | 2022-09-02 00:04:02 +0100 | [diff] [blame] | 103 | home.file.".mailcap".text = '' |
| 104 | text/html; ${pkgs.lynx}/bin/lynx -force_html -dump %s; copiousoutput |
| 105 | image/*; ${pkgs.kitty}/bin/kitty +kitten icat && read -r -n1 key |
| 106 | ''; |
| 107 | home.shellAliases = { |
| 108 | mutt = "${pkgs.neomutt}/bin/neomutt"; |
| 109 | }; |
| 110 | }; |
| 111 | config = { |
| 112 | sops.secrets.collaboraPassword = { |
| 113 | mode = "0400"; |
| 114 | owner = config.users.users.${username}.name; |
| 115 | group = config.users.users.nobody.group; |
| 116 | }; |
Skyler Grey | 252927a | 2022-10-18 22:18:15 +0100 | [diff] [blame] | 117 | environment.persistence."/nix/persist".users.${username}.directories = [ "Mail" ]; |
Skyler Grey | 8753c52 | 2022-09-02 00:04:02 +0100 | [diff] [blame] | 118 | }; |
| 119 | } |