1
0
Fork 0

Merge branch 'main' of ssh://code.8bitbuddhism.com/aires/nix-configuration

This commit is contained in:
Aires 2024-09-17 10:27:50 -04:00
commit 0693336769
2 changed files with 33 additions and 18 deletions

View file

@ -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";

View file

@ -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;
};
}