summary refs log tree commit diff
path: root/nixos/modules/programs/ssmtp.nix
diff options
context:
space:
mode:
authorChristian Kauhaus <kc@flyingcircus.io>2019-11-24 16:38:52 +0100
committerChristian Kauhaus <kc@flyingcircus.io>2019-11-26 11:08:44 +0100
commitdd87e9eb4da1e34df575eb546122809620d05aec (patch)
treecaf39ef92ec528456a171097f4c9fe90fabeae47 /nixos/modules/programs/ssmtp.nix
parent6127bf9837d201bc76d1aa16a85309b161ab07d8 (diff)
downloadnixpkgs-dd87e9eb4da1e34df575eb546122809620d05aec.tar
nixpkgs-dd87e9eb4da1e34df575eb546122809620d05aec.tar.gz
nixpkgs-dd87e9eb4da1e34df575eb546122809620d05aec.tar.bz2
nixpkgs-dd87e9eb4da1e34df575eb546122809620d05aec.tar.lz
nixpkgs-dd87e9eb4da1e34df575eb546122809620d05aec.tar.xz
nixpkgs-dd87e9eb4da1e34df575eb546122809620d05aec.tar.zst
nixpkgs-dd87e9eb4da1e34df575eb546122809620d05aec.zip
ssmtp: use services.ssmtp.* options
This PR is part of the networking.* namespace cleanup.

ssmtp used to be configured via `networking.defaultMailServer` which is
sort of misleading since it provides options only for ssmtp. Other
dumb mail relays like nullmailer have always been living under
services.

The intent of this PR is to align ssmtp's options with those of similar
services. Specifically, two renames have been done:

* Rename `networking.defaultMailHost` to `services.ssmtp`.
* Rename `directDelivery` to `enable` because this is what it basically does.
Diffstat (limited to 'nixos/modules/programs/ssmtp.nix')
-rw-r--r--nixos/modules/programs/ssmtp.nix14
1 files changed, 6 insertions, 8 deletions
diff --git a/nixos/modules/programs/ssmtp.nix b/nixos/modules/programs/ssmtp.nix
index 0e060e3f522..e45748af205 100644
--- a/nixos/modules/programs/ssmtp.nix
+++ b/nixos/modules/programs/ssmtp.nix
@@ -8,18 +8,16 @@
 with lib;
 
 let
-
-  cfg = config.networking.defaultMailServer;
+  cfg = config.services.ssmtp;
 
 in
-
 {
 
   options = {
 
-    networking.defaultMailServer = {
+    services.ssmtp = {
 
-      directDelivery = mkOption {
+      enable = mkOption {
         type = types.bool;
         default = false;
         description = ''
@@ -29,7 +27,7 @@ in
           <command>sendmail</command> or <command>postfix</command> on
           your machine, set this option to <literal>true</literal>, and
           set the option
-          <option>networking.defaultMailServer.hostName</option> to the
+          <option>services.ssmtp.hostName</option> to the
           host name of your preferred mail server.
         '';
       };
@@ -129,9 +127,9 @@ in
   };
 
 
-  config = mkIf cfg.directDelivery {
+  config = mkIf cfg.enable {
 
-    networking.defaultMailServer.authPassFile = mkIf (cfg.authPass != "")
+    services.ssmtp.authPassFile = mkIf (cfg.authPass != "")
       (mkDefault (toString (pkgs.writeTextFile {
         name = "ssmtp-authpass";
         text = cfg.authPass;