diff options
author | Joachim F <joachifm@users.noreply.github.com> | 2016-10-27 13:39:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-27 13:39:09 +0200 |
commit | 371a595f3c4476445a95acccb5695eb0cc9e9c64 (patch) | |
tree | 342e2966c2bae8267d93ec1ffe599d534a285b9c /nixos/modules | |
parent | 600f4dd080d768fc84009efbf1f6072d7f3c14ee (diff) | |
parent | ab1e216942a227d00ac8aaad84df6483335b14d1 (diff) | |
download | nixlib-371a595f3c4476445a95acccb5695eb0cc9e9c64.tar nixlib-371a595f3c4476445a95acccb5695eb0cc9e9c64.tar.gz nixlib-371a595f3c4476445a95acccb5695eb0cc9e9c64.tar.bz2 nixlib-371a595f3c4476445a95acccb5695eb0cc9e9c64.tar.lz nixlib-371a595f3c4476445a95acccb5695eb0cc9e9c64.tar.xz nixlib-371a595f3c4476445a95acccb5695eb0cc9e9c64.tar.zst nixlib-371a595f3c4476445a95acccb5695eb0cc9e9c64.zip |
Merge pull request #19874 from joachifm/opensmtpd-refactorings
Opensmtpd module refactorings
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/services/mail/opensmtpd.nix | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/nixos/modules/services/mail/opensmtpd.nix b/nixos/modules/services/mail/opensmtpd.nix index fb94560e10aa..5856b4697553 100644 --- a/nixos/modules/services/mail/opensmtpd.nix +++ b/nixos/modules/services/mail/opensmtpd.nix @@ -1,17 +1,16 @@ { config, lib, pkgs, ... }: -with pkgs; with lib; let cfg = config.services.opensmtpd; - conf = writeText "smtpd.conf" cfg.serverConfiguration; + conf = pkgs.writeText "smtpd.conf" cfg.serverConfiguration; args = concatStringsSep " " cfg.extraServerArgs; sendmail = pkgs.runCommand "opensmtpd-sendmail" {} '' mkdir -p $out/bin - ln -s ${opensmtpd}/sbin/smtpctl $out/bin/sendmail + ln -s ${pkgs.opensmtpd}/sbin/smtpctl $out/bin/sendmail ''; in { @@ -48,21 +47,19 @@ in { }; serverConfiguration = mkOption { - type = types.string; - default = ""; + type = types.lines; example = '' listen on lo accept for any deliver to lmtp localhost:24 - ''; + ''; description = '' The contents of the smtpd.conf configuration file. See the - OpenSMTPD documentation for syntax information. If this option - is left empty, the OpenSMTPD server will not start. + OpenSMTPD documentation for syntax information. ''; }; procPackages = mkOption { - type = types.listOf types.path; + type = types.listOf types.package; default = []; description = '' Packages to search for filters, tables, queues, and schedulers. @@ -100,12 +97,11 @@ in { systemd.services.opensmtpd = let procEnv = pkgs.buildEnv { name = "opensmtpd-procs"; - paths = [ opensmtpd ] ++ cfg.procPackages; + paths = [ pkgs.opensmtpd ] ++ cfg.procPackages; pathsToLink = [ "/libexec/opensmtpd" ]; }; in { wantedBy = [ "multi-user.target" ]; - wants = [ "network.target" ]; after = [ "network.target" ]; preStart = '' mkdir -p /var/spool/smtpd |