1
0
Fork 0
nix-configuration/modules/services/msmtp.nix

34 lines
778 B
Nix
Raw Normal View History

# See https://wiki.nixos.org/wiki/Msmtp
{ config, lib, ... }:
2024-02-29 09:53:34 -05:00
let
cfg = config.aux.system.services.msmtp;
2024-02-29 09:53:34 -05:00
in
{
options = {
2024-09-15 14:39:26 -04:00
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 = { };
2024-09-15 14:39:26 -04:00
type = lib.types.attrs;
description = "Optional email aliases to add.";
};
};
};
2024-02-29 09:53:34 -05:00
2024-08-02 17:55:48 -04:00
config = lib.mkIf cfg.enable {
programs.msmtp = {
enable = true;
2024-08-16 15:41:13 -04:00
defaults.aliases = "/etc/aliases";
2024-09-15 14:39:26 -04:00
accounts = cfg.accounts;
};
2024-08-16 15:41:13 -04:00
# Send all mail to my email address by default
2024-09-15 14:39:26 -04:00
environment.etc."aliases" = cfg.aliases;
};
}