mailhog: init at 1.0.0 (#26821)
* mailhog: init at 1.0.0 * formatting nitpicks
This commit is contained in:
committed by
Jörg Thalheim
parent
da1525260b
commit
5d7fd7e7fa
@@ -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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user