blob: da7b779a2602b09989c08c9d1d7385e2a00c85ac (
plain) (
blame)
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
|
{
config,
options,
lib,
pkgs,
...
}: let
muttConfig = config.modules.desktop.apps.mutt;
in
{
options.modules.desktop.apps.mutt = {
enable = lib.mkOption {
type = lib.types.bool;
default = false;
};
};
config = lib.mkIf (muttConfig.enable) {
home.packages = [
pkgs.neomutt
pkgs.isync
pkgs.lynx
pkgs.mutt-wizard
];
systemd.timers."auto-mailsync" = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnBootSec = "10m";
OnUnitActiveSec = "10m";
Unit = "auto-mailsync.service";
};
};
systemd.services."auto-mailsync" = {
script = ''
set -eu
/run/current-system/sw/bin/bash -l -c '${pkgs.mutt-wizard}/bin/mailsync -Y'
'';
serviceConfig = {
Type = "oneshot";
User = "jon";
};
};
};
}
|