diff options
author | Samuel Leathers <disasm@gmail.com> | 2017-06-24 12:05:34 -0400 |
---|---|---|
committer | Jörg Thalheim <Mic92@users.noreply.github.com> | 2017-06-24 17:05:34 +0100 |
commit | 5d7fd7e7fa2a488d6df92da30933c27aad7530b6 (patch) | |
tree | 29cc6150f223f5268719f8052d93c947f6ff9c63 /nixos/modules | |
parent | da1525260bc88107335611043d6ded77b09e5149 (diff) | |
download | nixlib-5d7fd7e7fa2a488d6df92da30933c27aad7530b6.tar nixlib-5d7fd7e7fa2a488d6df92da30933c27aad7530b6.tar.gz nixlib-5d7fd7e7fa2a488d6df92da30933c27aad7530b6.tar.bz2 nixlib-5d7fd7e7fa2a488d6df92da30933c27aad7530b6.tar.lz nixlib-5d7fd7e7fa2a488d6df92da30933c27aad7530b6.tar.xz nixlib-5d7fd7e7fa2a488d6df92da30933c27aad7530b6.tar.zst nixlib-5d7fd7e7fa2a488d6df92da30933c27aad7530b6.zip |
mailhog: init at 1.0.0 (#26821)
* mailhog: init at 1.0.0 * formatting nitpicks
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/module-list.nix | 1 | ||||
-rw-r--r-- | nixos/modules/services/mail/mailhog.nix | 43 |
2 files changed, 44 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 7f94d6569e97..07be6555b233 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -252,6 +252,7 @@ ./services/mail/exim.nix ./services/mail/freepops.nix ./services/mail/mail.nix + ./services/mail/mailhog.nix ./services/mail/mlmmj.nix ./services/mail/offlineimap.nix ./services/mail/opendkim.nix diff --git a/nixos/modules/services/mail/mailhog.nix b/nixos/modules/services/mail/mailhog.nix new file mode 100644 index 000000000000..206fb50d31a2 --- /dev/null +++ b/nixos/modules/services/mail/mailhog.nix @@ -0,0 +1,43 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.services.mailhog; +in { + ###### interface + + options = { + + services.mailhog = { + enable = mkEnableOption "MailHog"; + user = mkOption { + type = types.str; + default = "mailhog"; + description = "User account under which mailhog runs."; + }; + }; + }; + + + ###### implementation + + config = mkIf cfg.enable { + + users.extraUsers.mailhog = { + name = cfg.user; + description = "MailHog service user"; + }; + + systemd.services.mailhog = { + description = "MailHog service"; + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + Type = "simple"; + ExecStart = "${pkgs.mailhog}/bin/MailHog"; + User = cfg.user; + }; + }; + }; +} |