1 { config, lib, pkgs, ... }:
3 cfg = config.services.epmd;
7 options.services.epmd = {
8 enable = lib.mkOption {
12 Whether to enable socket activation for Erlang Port Mapper Daemon (epmd),
13 which acts as a name server on all hosts involved in distributed
17 package = lib.mkPackageOption pkgs "erlang" { };
18 listenStream = lib.mkOption
21 default = "[::]:4369";
23 the listenStream used by the systemd socket.
24 see https://www.freedesktop.org/software/systemd/man/systemd.socket.html#ListenStream= for more information.
25 use this to change the port epmd will run on.
26 if not defined, epmd will use "[::]:4369"
32 config = lib.mkIf cfg.enable {
34 assertion = cfg.listenStream == "[::]:4369" -> config.networking.enableIPv6;
35 message = "epmd listens by default on ipv6, enable ipv6 or change config.services.epmd.listenStream";
37 systemd.sockets.epmd = rec {
38 description = "Erlang Port Mapper Daemon Activation Socket";
39 wantedBy = [ "sockets.target" ];
42 ListenStream = cfg.listenStream;
47 systemd.services.epmd = {
48 description = "Erlang Port Mapper Daemon";
49 after = [ "network.target" ];
50 requires = [ "epmd.socket" ];
54 ExecStart = "${cfg.package}/bin/epmd -systemd";
60 meta.maintainers = lib.teams.beam.members;