Add more mail
This commit is contained in:
parent
5cbd37bd44
commit
ca16d4edd5
Binary file not shown.
65
home-manager/modules/mail.nix
Normal file
65
home-manager/modules/mail.nix
Normal file
|
@ -0,0 +1,65 @@
|
|||
{ lib, config, pkgs, ...}:
|
||||
with lib;
|
||||
let
|
||||
mail = config.m-0.mail;
|
||||
mkMailbox = {password, user, host, name}:
|
||||
''
|
||||
IMAPAccount ${name}
|
||||
Host ${host}
|
||||
User ${user}
|
||||
Pass ${password}
|
||||
SSLType IMAPS
|
||||
|
||||
IMAPStore ${name}-remote
|
||||
Account ${name}
|
||||
|
||||
MaildirStore ${name}-local
|
||||
Path ~/mail/${name}/
|
||||
Inbox ~/mail/${name}/INBOX/
|
||||
Subfolders Verbatim
|
||||
AltMap yes
|
||||
|
||||
Channel ${name}
|
||||
Master :${name}-remote:
|
||||
Slave :${name}-local:
|
||||
Patterns *
|
||||
Create Both
|
||||
Expunge Both
|
||||
Remove Both
|
||||
SyncState *
|
||||
'';
|
||||
|
||||
in {
|
||||
options.m-0.mail.enable = mkEnableOption "private-mail";
|
||||
options.m-0.mail.boxes = mkOption {
|
||||
type = types.listOf types.attrs;
|
||||
};
|
||||
|
||||
config = mkIf mail.enable {
|
||||
services.mbsync = {
|
||||
enable = true;
|
||||
configFile = builtins.toFile "mbsync-conf" (builtins.concatStringsSep "\n" (builtins.map mkMailbox mail.boxes));
|
||||
};
|
||||
home = {
|
||||
packages = [ pkgs.neomutt ];
|
||||
file.".neomuttrc".text = ''
|
||||
set folder="~/mail/"
|
||||
mailboxes `find ~/mail -type d -name INBOX -printf '"%h" '` `find ~/mail -type d -name cur -printf '"%h" '`
|
||||
set spoolfile="~/mail/m-0/INBOX"
|
||||
set sidebar_folder_indent=yes
|
||||
set sidebar_short_path=yes
|
||||
set sidebar_visible=yes
|
||||
set sidebar_width=40
|
||||
set sidebar_sort_method="alpha"
|
||||
set sidebar_indent_string=" "
|
||||
set mail_check_stats=yes
|
||||
bind index,pager \CP sidebar-prev
|
||||
bind index,pager \CN sidebar-next
|
||||
bind index,pager \CO sidebar-open
|
||||
color sidebar_indicator black white
|
||||
color sidebar_highlight white blue
|
||||
set sidebar_format = "%B%?F? [%F]?%* %?N?%N/?%S"
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, ... }:
|
||||
{ pkgs, config, ... }:
|
||||
{
|
||||
|
||||
imports = [
|
||||
|
@ -20,5 +20,9 @@ m-0.unlocker = [ {
|
|||
pubKey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCHkqWlFLtmIlTSKahr2PcL++K75YgfsSU6jwVYW5df3JCkowu/M16SIBxABxYSQrKej5uIz/OFCjqSxHJQ8D5wSYBvn2gYr/BbBcz4rfIJmZ55Od2jckaqlj/M8TtkuPPhsQG7S730vXxK5hbMT8iW5WWv8sIKY/WtaRbZOFMX/53WCLEHtnMu5zFJFWf92+mjIHSLyW8ggl1m525RUiaAfCge2vnuzIFq4kUqJxaWzxIvEWIncKWN10K/HMvdI+yOtbSen41uKedwSFhUFs3xHy1mJddYOrlcJQPt5zuuffZ/nTDVXMZoh5QNwg8ZlkkueVChaS1Y5STjb7cem1Mt";
|
||||
passPath = "eu/m-0/hera/disk";
|
||||
} ];
|
||||
m-0.mail = {
|
||||
enable = true;
|
||||
boxes = [ config.m-0.private.mail.private config.m-0.private.mail.work config.m-0.private.mail.work2 ];
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue