8 cfg = config.services.epmd;
12 options.services.epmd = {
13 enable = lib.mkOption {
14 type = lib.types.bool;
17 Whether to enable socket activation for Erlang Port Mapper Daemon (epmd),
18 which acts as a name server on all hosts involved in distributed
22 package = lib.mkPackageOption pkgs "erlang" { };
23 listenStream = lib.mkOption {
25 default = "[::]:4369";
27 the listenStream used by the systemd socket.
28 see https://www.freedesktop.org/software/systemd/man/systemd.socket.html#ListenStream= for more information.
29 use this to change the port epmd will run on.
30 if not defined, epmd will use "[::]:4369"
36 config = lib.mkIf cfg.enable {
39 assertion = cfg.listenStream == "[::]:4369" -> config.networking.enableIPv6;
40 message = "epmd listens by default on ipv6, enable ipv6 or change config.services.epmd.listenStream";
43 systemd.sockets.epmd = rec {
44 description = "Erlang Port Mapper Daemon Activation Socket";
45 wantedBy = [ "sockets.target" ];
48 ListenStream = cfg.listenStream;
53 systemd.services.epmd = {
54 description = "Erlang Port Mapper Daemon";
55 after = [ "network.target" ];
56 requires = [ "epmd.socket" ];
60 ExecStart = "${cfg.package}/bin/epmd -systemd";
66 meta.maintainers = lib.teams.beam.members;