Merge branch 'main' of ssh://code.8bitbuddhism.com/aires/nix-configuration
This commit is contained in:
commit
0693336769
|
@ -154,7 +154,25 @@ in
|
|||
home = "${services-root}/jellyfin";
|
||||
url = config.secrets.services.jellyfin.url;
|
||||
};
|
||||
msmtp.enable = true;
|
||||
msmtp = {
|
||||
enable = true;
|
||||
accounts.default = {
|
||||
host = config.secrets.services.msmtp.host;
|
||||
user = config.secrets.services.msmtp.user;
|
||||
password = config.secrets.services.msmtp.password;
|
||||
auth = true;
|
||||
tls = true;
|
||||
tls_starttls = true;
|
||||
port = 587;
|
||||
from = "${config.networking.hostName}@${config.secrets.networking.domains.primary}";
|
||||
};
|
||||
aliases = {
|
||||
text = ''
|
||||
default: ${config.secrets.users.aires.email}
|
||||
'';
|
||||
mode = "0644";
|
||||
};
|
||||
};
|
||||
netdata = {
|
||||
enable = true;
|
||||
type = "parent";
|
||||
|
|
|
@ -6,31 +6,28 @@ let
|
|||
in
|
||||
{
|
||||
options = {
|
||||
aux.system.services.msmtp.enable = lib.mkEnableOption "Enables mail server";
|
||||
aux.system.services.msmtp = {
|
||||
enable = lib.mkEnableOption "Enables mail server";
|
||||
accounts = lib.mkOption {
|
||||
type = lib.types.attrs;
|
||||
description = "A list of accounts to use for msmtp.";
|
||||
};
|
||||
aliases = lib.mkOption {
|
||||
default = { };
|
||||
type = lib.types.attrs;
|
||||
description = "Optional email aliases to add.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.msmtp = {
|
||||
enable = true;
|
||||
defaults.aliases = "/etc/aliases";
|
||||
accounts.default = {
|
||||
host = config.secrets.services.msmtp.host;
|
||||
user = config.secrets.services.msmtp.user;
|
||||
password = config.secrets.services.msmtp.password;
|
||||
auth = true;
|
||||
tls = true;
|
||||
tls_starttls = true;
|
||||
port = 587;
|
||||
from = "${config.networking.hostName}@${config.secrets.networking.domains.primary}";
|
||||
};
|
||||
accounts = cfg.accounts;
|
||||
};
|
||||
|
||||
# Send all mail to my email address by default
|
||||
environment.etc."aliases" = {
|
||||
text = ''
|
||||
default: ${config.secrets.users.aires.email}
|
||||
'';
|
||||
mode = "0644";
|
||||
};
|
||||
environment.etc."aliases" = cfg.aliases;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue