1 { config, lib, pkgs, ... }:
6 cfg = config.services.epmd;
10 options.services.epmd = {
14 description = lib.mdDoc ''
15 Whether to enable socket activation for Erlang Port Mapper Daemon (epmd),
16 which acts as a name server on all hosts involved in distributed
22 default = pkgs.erlang;
23 defaultText = literalExpression "pkgs.erlang";
24 description = lib.mdDoc ''
25 The Erlang package to use to get epmd binary. That way you can re-use
26 an Erlang runtime that is already installed for other purposes.
29 listenStream = mkOption
32 default = "[::]:4369";
33 description = lib.mdDoc ''
34 the listenStream used by the systemd socket.
35 see https://www.freedesktop.org/software/systemd/man/systemd.socket.html#ListenStream= for more informations.
36 use this to change the port epmd will run on.
37 if not defined, epmd will use "[::]:4369"
43 config = mkIf cfg.enable {
45 assertion = cfg.listenStream == "[::]:4369" -> config.networking.enableIPv6;
46 message = "epmd listens by default on ipv6, enable ipv6 or change config.services.epmd.listenStream";
48 systemd.sockets.epmd = rec {
49 description = "Erlang Port Mapper Daemon Activation Socket";
50 wantedBy = [ "sockets.target" ];
53 ListenStream = cfg.listenStream;
58 systemd.services.epmd = {
59 description = "Erlang Port Mapper Daemon";
60 after = [ "network.target" ];
61 requires = [ "epmd.socket" ];
65 ExecStart = "${cfg.package}/bin/epmd -systemd";
71 meta.maintainers = teams.beam.members;