mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-06-08 10:09:04 +02:00
Added newton config
This commit is contained in:
parent
f3cdf9d3e2
commit
736c627795
13 changed files with 1030 additions and 8 deletions
73
home-manager-modules/mails/default.nix
Normal file
73
home-manager-modules/mails/default.nix
Normal file
|
@ -0,0 +1,73 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
let
|
||||
cfg = config.luj.emails;
|
||||
in
|
||||
with lib;
|
||||
{
|
||||
options.luj.emails = {
|
||||
enable = mkEnableOption "enable mail management";
|
||||
backend.enable = mkEnableOption "enable filtering backend";
|
||||
};
|
||||
|
||||
|
||||
config = mkMerge [
|
||||
(mkIf cfg.enable {
|
||||
programs.mbsync.enable = true;
|
||||
programs.neomutt.enable = true;
|
||||
programs.msmtp.enable = true;
|
||||
accounts.email = {
|
||||
accounts.ens = {
|
||||
address = "julien.malka@ens.fr";
|
||||
imap.host = "clipper.ens.fr";
|
||||
mbsync = {
|
||||
enable = true;
|
||||
create = "maildir";
|
||||
extraConfig.channel = {
|
||||
"CopyArrivalDate" = "yes";
|
||||
};
|
||||
};
|
||||
msmtp.enable = true;
|
||||
primary = true;
|
||||
realName = "Julien Malka";
|
||||
passwordCommand = "${pkgs.gnupg}/bin/gpg -q --batch --passphrase-file /home/julien/email-passphrase -d ${./ens.pass.gpg}";
|
||||
smtp = {
|
||||
host = "clipper.ens.fr";
|
||||
};
|
||||
userName = "jmalka";
|
||||
};
|
||||
};
|
||||
services.mbsync = {
|
||||
enable = true;
|
||||
frequency = "*-*-* *:*:00";
|
||||
verbose = false;
|
||||
};
|
||||
xdg.configFile = {
|
||||
"neomutt/neomuttrc".source = lib.mkForce ./neomuttrc;
|
||||
};
|
||||
|
||||
|
||||
})
|
||||
|
||||
(mkIf (cfg.enable && cfg.backend.enable) {
|
||||
programs.afew.enable = true;
|
||||
accounts.email.accounts.ens.notmuch.enable = true;
|
||||
services.mbsync.postExec = "${pkgs.notmuch}/bin/notmuch new";
|
||||
programs.notmuch = {
|
||||
enable = true;
|
||||
new.tags = [ "new" ];
|
||||
hooks.postNew = ''
|
||||
${pkgs.afew}/bin/afew --tag --new
|
||||
${pkgs.afew}/bin/afew --move-mails
|
||||
'';
|
||||
};
|
||||
xdg.configFile = {
|
||||
"afew/config".source = lib.mkForce ./afewconfig;
|
||||
};
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
];
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue