blob: eb70e2bf19f3224c37e78337687acf6e4bd278ee (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
{ config, lib, pkgs, ... }:
let
cfg = config.personal.identities;
mkEnableIdentityOption = name: lib.mkEnableOption "${name} identity";
in {
options.personal.identities = {
personal = mkEnableIdentityOption "personal";
work = mkEnableIdentityOption "work";
};
config = {
accounts.email.accounts = let
gpg = {
key = "DFC1660846EEA97C059F18534EF515441E635D36";
signByDefault = true;
};
thunderbirdSettings = id: {
"mail.identity.id_${id}.fcc_folder_picker_mode" = 0;
};
in {
personal = lib.mkIf config.personal.identities.personal {
inherit gpg;
address = "quentin@aristote.fr";
userName = "quentin@aristote.fr";
realName = "Quentin Aristote";
folders = {
drafts = "INBOX/Brouillons";
inbox = "INBOX";
sent = "INBOX/Envoyés";
trash = "INBOX/Corbeille";
};
imap = {
host = "ssl0.ovh.net";
port = 993;
};
smtp = {
host = "ssl0.ovh.net";
port = 465;
};
thunderbird = {
enable = true;
profiles = [ "default" ];
settings = id:
thunderbirdSettings id // {
"mail.identity.id_${id}.draft_folder" =
"imap://quentin%40aristote.fr@ssl0.ovh.net/INBOX/Brouillons";
"mail.identity.id_${id}.fcc_folder" =
"imap://quentin%40aristote.fr@ssl0.ovh.net/INBOX/Envoy&AOk-s";
"mail.identity.id_${id}.archive_folder" =
"imap://quentin%40aristote.fr@ssl0.ovh.net/INBOX/Archive";
"mail.server.server_${id}.trash_folder_name" = "INBOX/Corbeille";
};
};
};
work = lib.mkIf config.personal.identities.work {
inherit gpg;
address = "quentin.aristote@ens.fr";
userName = "qaristote";
realName = "Quentin Aristote";
aliases = [
"quentin.aristote@ens.psl.eu"
"qaristote@clipper.ens.fr"
"qaristote@clipper.ens.psl.eu"
];
folders = {
drafts = "Drafts";
inbox = "Inbox";
sent = "Sent";
trash = "Trash";
};
imap = {
host = "clipper.ens.fr";
port = 993;
};
smtp = {
host = "clipper.ens.fr";
port = 465;
};
thunderbird = {
enable = true;
profiles = [ "default" ];
settings = id:
thunderbirdSettings id // {
"mail.identity.id_${id}.archive_folder" =
"imap://qaristote@clipper.ens.fr/Archive";
"mail.server.server_${id}.trash_folder_name" = "Trash";
};
};
};
};
home.packages = lib.optionals cfg.personal (with pkgs; [ ])
++ lib.optionals cfg.work (with pkgs; [ zotero ]);
};
}
|