Formatted
This commit is contained in:
@@ -1,73 +1,87 @@
|
||||
#https://xeiaso.net/talks/asg-2023-nixos/ example
|
||||
{ lib, config, pkgs, ... }:
|
||||
let
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
isEnabled =
|
||||
config.azos.mail.enable;
|
||||
default_account_params = {
|
||||
realName = "Aner Zakobar";
|
||||
notmuch.enable = true;
|
||||
mbsync = {
|
||||
enable = true;
|
||||
create = "maildir";
|
||||
enable = true;
|
||||
create = "maildir";
|
||||
};
|
||||
};
|
||||
default_gmail_params = default_account_params // {
|
||||
# lieer.enable = true;
|
||||
# lieer.sync.enable = true;
|
||||
flavor = "gmail.com";
|
||||
# imap = {
|
||||
# host = "mail.privateemail.com";
|
||||
# };
|
||||
};
|
||||
default_gmail_params =
|
||||
default_account_params
|
||||
// {
|
||||
# lieer.enable = true;
|
||||
# lieer.sync.enable = true;
|
||||
flavor = "gmail.com";
|
||||
# imap = {
|
||||
# host = "mail.privateemail.com";
|
||||
# };
|
||||
};
|
||||
default_smtp = {
|
||||
tls = {
|
||||
enable = true;
|
||||
certificatesFile = "/etc/ssl/certs/ca-certificates.crt";
|
||||
};
|
||||
};
|
||||
default_gmail_smtp = default_smtp // {
|
||||
host = "smtp.gmail.com";
|
||||
};
|
||||
in {
|
||||
options.azos.mail.enable = lib.mkOption {
|
||||
default = true;
|
||||
example = true;
|
||||
type = lib.types.bool;
|
||||
default_gmail_smtp =
|
||||
default_smtp
|
||||
// {
|
||||
host = "smtp.gmail.com";
|
||||
};
|
||||
in {
|
||||
options.azos.mail.enable = lib.mkOption {
|
||||
default = true;
|
||||
example = true;
|
||||
type = lib.types.bool;
|
||||
};
|
||||
|
||||
config = lib.mkIf isEnabled {
|
||||
programs= {
|
||||
notmuch = {
|
||||
enable = true;
|
||||
hooks = {
|
||||
preNew = "mbsync -a";
|
||||
};
|
||||
};
|
||||
mbsync = {
|
||||
enable = true;
|
||||
};
|
||||
msmtp = {
|
||||
enable = true;
|
||||
};
|
||||
lieer = {
|
||||
enable = true;
|
||||
config = lib.mkIf isEnabled {
|
||||
programs = {
|
||||
notmuch = {
|
||||
enable = true;
|
||||
hooks = {
|
||||
preNew = "mbsync -a";
|
||||
};
|
||||
};
|
||||
services.lieer.enable = true;
|
||||
accounts.email.accounts = {
|
||||
gmail = default_gmail_params // {
|
||||
mbsync = {
|
||||
enable = true;
|
||||
};
|
||||
msmtp = {
|
||||
enable = true;
|
||||
};
|
||||
lieer = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
services.lieer.enable = true;
|
||||
accounts.email.accounts = {
|
||||
gmail =
|
||||
default_gmail_params
|
||||
// {
|
||||
address = "anerisgreat@gmail.com";
|
||||
userName = "anerisgreat";
|
||||
# smtp = default_gmail_smtp;
|
||||
passwordCommand = "pass gmail.com/mbsync-anerisgreat";
|
||||
};
|
||||
bgu = default_gmail_params // {
|
||||
bgu =
|
||||
default_gmail_params
|
||||
// {
|
||||
address = "anerz@post.bgu.ac.il";
|
||||
userName = "anerz@post.bgu.ac.il";
|
||||
# smtp = default_gmail_smtp;
|
||||
passwordCommand = "pass post.bgu.ac.il/mbsync-anerz";
|
||||
};
|
||||
zakobar = default_account_params // {
|
||||
zakobar =
|
||||
default_account_params
|
||||
// {
|
||||
address = "aner@zakobar.com";
|
||||
msmtp.enable = true;
|
||||
|
||||
@@ -81,13 +95,14 @@ in {
|
||||
# create = "maildir";
|
||||
# };
|
||||
|
||||
smtp = default_smtp // {
|
||||
port = 587;
|
||||
host = "mail.privateemail.com";
|
||||
};
|
||||
smtp =
|
||||
default_smtp
|
||||
// {
|
||||
port = 587;
|
||||
host = "mail.privateemail.com";
|
||||
};
|
||||
passwordCommand = "pass zakobar.com/mail/aner";
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user