This commit is contained in:
commit
fef2377502
174 changed files with 7423 additions and 0 deletions
47
nixos-modules/outgoing-server-mail/default.nix
Normal file
47
nixos-modules/outgoing-server-mail/default.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.qois.outgoing-server-mail;
|
||||
in
|
||||
with lib;
|
||||
{
|
||||
options.qois.outgoing-server-mail = {
|
||||
enable = mkEnableOption ''Enable outgoing emails for server.'';
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
sops.secrets."msmtp/password" = {
|
||||
owner = "root";
|
||||
group = config.users.groups.postdrop.name;
|
||||
mode = "0440";
|
||||
};
|
||||
|
||||
users.groups.postdrop = { };
|
||||
|
||||
programs.msmtp = {
|
||||
enable = true;
|
||||
defaults = {
|
||||
aliases = pkgs.writeText "aliases" ''
|
||||
root: sysadmin@qo.is
|
||||
'';
|
||||
port = 465;
|
||||
tls = true;
|
||||
tls_starttls = "off";
|
||||
|
||||
};
|
||||
accounts.default = {
|
||||
auth = true;
|
||||
host = "mail.cyon.ch";
|
||||
user = "system@qo.is";
|
||||
from = "no-reply@qo.is";
|
||||
passwordeval = "${pkgs.busybox}/bin/cat ${config.sops.secrets."msmtp/password".path}";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue