From 261611708ca7623600d38846b232f979ccf5fa4a Mon Sep 17 00:00:00 2001 From: Katalin Rebhan Date: Thu, 23 Apr 2026 00:44:10 +0200 Subject: [PATCH] nixos/ejabberd: use standalone epmd service There can only be one epmd per machine, and ejabberd will spawn it in its context if it is not running. This is fine if ejabberd is the only Erlang application running on the machine, but it will cause problems when coexisting with others. Specifically when services.epmd is enabled at the same time, this will cause a port collision if epmd.socket starts up after ejabberd.service. Make sure that doesn't happen by depending on services.epmd. --- nixos/modules/services/networking/ejabberd.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/networking/ejabberd.nix b/nixos/modules/services/networking/ejabberd.nix index c4d692812c47..908aaec2d070 100644 --- a/nixos/modules/services/networking/ejabberd.nix +++ b/nixos/modules/services/networking/ejabberd.nix @@ -93,6 +93,8 @@ in config = lib.mkIf cfg.enable { environment.systemPackages = [ cfg.package ]; + services.epmd.enable = true; + users.users = lib.optionalAttrs (cfg.user == "ejabberd") { ejabberd = { group = cfg.group; @@ -109,7 +111,11 @@ in systemd.services.ejabberd = { description = "ejabberd server"; wantedBy = [ "multi-user.target" ]; - after = [ "network.target" ]; + after = [ + "network.target" + "epmd.socket" + ]; + wants = [ "epmd.socket" ]; path = [ pkgs.findutils pkgs.coreutils