blob: 8e5d51bc65a8565109cd4f16a39dbbc528f122bd (
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
|
# Email suite entry point
{
config,
lib,
pkgs,
...
}:
let
inherit ((import ../../lib/script.nix { inherit lib pkgs; })) mkScriptModule;
neomuttSync = mkScriptModule {
scope = [
"communication"
"neomutt"
];
name = "neomutt-sync";
path = ./neomutt-sync.sh;
description = "Neomutt-sync - Interactive mail sync with dialog progress bar";
deps = [
pkgs.bash
pkgs.dialog
pkgs.coreutils
pkgs.gawk
pkgs.gnused
pkgs.util-linux
config.programs.mbsync.package
config.programs.notmuch.package
];
inherit config;
};
in
{
imports = [
./account
./mail
./assertions.nix
./keybindings.nix
./macros.nix
./neomutt.nix
];
options.communication.neomutt = {
enable = lib.mkEnableOption "Email suite (neomutt + mbsync + notmuch)";
package = lib.mkOption {
type = lib.types.package;
readOnly = true;
default = config.programs.neomutt.package;
description = "The neomutt package to use, wrapped with urlscan in PATH.";
};
}
// neomuttSync.options.communication.neomutt;
config = lib.mkMerge [
(lib.mkIf config.communication.neomutt.enable {
accounts.email.maildirBasePath = "${config.home.homeDirectory}/.local/share/mail";
home.sessionVariables.MAILDIR = config.accounts.email.maildirBasePath;
})
neomuttSync.config
{
assertions = [
{
assertion =
!config.communication.neomutt.neomutt-sync.enable || config.communication.neomutt.enable;
message = "communication.neomutt.neomutt-sync is enabled but requires `communication.neomutt.enable`.";
}
];
}
];
}
|