diff options
author | Azat Bahawi <azat@bahawi.net> | 2023-03-20 18:39:29 +0300 |
---|---|---|
committer | Azat Bahawi <azat@bahawi.net> | 2023-03-20 18:39:29 +0300 |
commit | 773ba5e5ea810f104127b7ca28e541875f763599 (patch) | |
tree | 6b39260200371b2e51455c4510c37d29e890c3cc /modules/nixos/nullmailer.nix | |
parent | 2023-03-20 (diff) |
2023-03-20
Diffstat (limited to '')
-rw-r--r-- | modules/nixos/nullmailer.nix | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/modules/nixos/nullmailer.nix b/modules/nixos/nullmailer.nix new file mode 100644 index 0000000..193b109 --- /dev/null +++ b/modules/nixos/nullmailer.nix @@ -0,0 +1,28 @@ +{ + 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; + }; + }; +} |