File tree Expand file tree Collapse file tree 5 files changed +30
-6
lines changed Expand file tree Collapse file tree 5 files changed +30
-6
lines changed Original file line number Diff line number Diff line change 243
243
// optPwCmd "outgoing" passwordCommand ;
244
244
245
245
msmtp = cfg : {
246
- outgoing = "msmtpq --read-envelope-from --read-recipients" ;
246
+ outgoing = "${ config . msmtp . msmtpCommand } --read-envelope-from --read-recipients" ;
247
247
} ;
248
248
249
249
} ;
Original file line number Diff line number Diff line change 58
58
59
59
config = lib . mkIf config . notmuch . enable {
60
60
alot . sendMailCommand = lib . mkOptionDefault (
61
- if config . msmtp . enable then "msmtpq --read-envelope-from --read-recipients" else null
61
+ if config . msmtp . enable then
62
+ "${ config . msmtp . msmtpCommand } --read-envelope-from --read-recipients"
63
+ else
64
+ null
62
65
) ;
63
66
} ;
64
67
}
Original file line number Diff line number Diff line change 26
26
27
27
config = lib . mkIf config . notmuch . enable {
28
28
astroid . sendMailCommand = lib . mkIf config . msmtp . enable (
29
- lib . mkOptionDefault "msmtpq --read-envelope-from --read-recipients"
29
+ lib . mkOptionDefault "${ config . msmtp . msmtpCommand } --read-envelope-from --read-recipients"
30
30
) ;
31
31
} ;
32
32
}
Original file line number Diff line number Diff line change 52
52
{
53
53
54
54
options = {
55
- programs . msmtp = {
55
+ programs . msmtp = rec {
56
56
enable = lib . mkEnableOption "msmtp" ;
57
57
58
58
package = lib . mkPackageOption pkgs "msmtp" { } ;
114
114
See <https://marlam.de/msmtp/msmtprc.txt> for examples.
115
115
'' ;
116
116
} ;
117
+
118
+ msmtpCommand = mkOption {
119
+ type = types . package ;
120
+ internal = true ;
121
+ readOnly = true ;
122
+ default = if offlineSupport then "${ pkgs . msmtp } /bin/msmtpq" else "${ pkgs . msmtp } /bin/msmtp" ;
123
+ } ;
124
+
125
+ offlineSupport = lib . mkOption {
126
+ type = types . bool ;
127
+ default = true ;
128
+ description = ''
129
+ Use msmtpq script instead of msmtp. The script allows an offline
130
+ first workflow by adding all mails to a queue regardless of the
131
+ network status, and flushing them later.
132
+ '' ;
133
+ } ;
117
134
} ;
118
135
119
136
accounts . email . accounts = mkOption {
135
152
( lib . mkIf ( cfg . extraAccounts != "" ) ( lib . mkAfter cfg . extraAccounts ) )
136
153
] ;
137
154
138
- home . sessionVariables = {
155
+ home . sessionVariables = lib . optionalAttrs cfg . offlineSupport {
139
156
MSMTPQ_Q = "${ config . xdg . dataHome } /msmtp/queue" ;
140
157
MSMTPQ_LOG = "${ config . xdg . dataHome } /msmtp/queue.log" ;
141
158
} ;
Original file line number Diff line number Diff line change 61
61
62
62
sendMailCommand = mkOption {
63
63
type = types . nullOr types . str ;
64
- default = if config . msmtp . enable then "msmtpq --read-envelope-from --read-recipients" else null ;
64
+ default =
65
+ if config . msmtp . enable then
66
+ "${ config . msmtp . msmtpCommand } --read-envelope-from --read-recipients"
67
+ else
68
+ null ;
65
69
defaultText = lib . literalExpression ''
66
70
if config.msmtp.enable then
67
71
"msmtpq --read-envelope-from --read-recipients"
You can’t perform that action at this time.
0 commit comments