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"; home = "${services-root}/jellyfin";
url = config.secrets.services.jellyfin.url; 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 = { netdata = {
enable = true; enable = true;
type = "parent"; type = "parent";

View file

@ -6,31 +6,28 @@ let
in in
{ {
options = { 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 { config = lib.mkIf cfg.enable {
programs.msmtp = { programs.msmtp = {
enable = true; enable = true;
defaults.aliases = "/etc/aliases"; defaults.aliases = "/etc/aliases";
accounts.default = { accounts = cfg.accounts;
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}";
};
}; };
# Send all mail to my email address by default # Send all mail to my email address by default
environment.etc."aliases" = { environment.etc."aliases" = cfg.aliases;
text = ''
default: ${config.secrets.users.aires.email}
'';
mode = "0644";
};
}; };
} }