From e6ed60548397627bf10f561f9438201dbba0a36e Mon Sep 17 00:00:00 2001 From: Azat Bahawi Date: Sun, 21 Apr 2024 02:15:42 +0300 Subject: 2024-04-21 --- modules/nullmailer.nix | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 modules/nullmailer.nix (limited to 'modules/nullmailer.nix') diff --git a/modules/nullmailer.nix b/modules/nullmailer.nix new file mode 100644 index 0000000..9f7b4ac --- /dev/null +++ b/modules/nullmailer.nix @@ -0,0 +1,30 @@ +{ + config, + inputs, + lib, + ... +}: +with lib; +let + cfg = config.nixfiles.modules.nullmailer; +in +{ + options.nixfiles.modules.nullmailer.enable = mkEnableOption "Nullmailer"; + + config = mkIf cfg.enable { + # No use in enabling it other than having a retry queue. + # ark.directories = ["/var/spool/nullmailer"]; + + secrets.nullmailer-remotes = with config.services.nullmailer; { + file = "${inputs.self}/secrets/nullmailer-remotes"; + owner = user; + inherit group; + }; + + services.nullmailer = { + enable = true; + remotesFile = config.secrets.nullmailer-remotes.path; + config.me = config.networking.domain; + }; + }; +} -- cgit v1.2.3