mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-18 11:40:45 +00:00
6afb255d97
these changes were generated with nixq 0.0.2, by running nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix two mentions of the mdDoc function remain in nixos/, both of which are inside of comments. Since lib.mdDoc is already defined as just id, this commit is a no-op as far as Nix (and the built manual) is concerned.
65 lines
1.7 KiB
Nix
65 lines
1.7 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.services.epmd;
|
|
in
|
|
{
|
|
###### interface
|
|
options.services.epmd = {
|
|
enable = mkOption {
|
|
type = types.bool;
|
|
default = false;
|
|
description = ''
|
|
Whether to enable socket activation for Erlang Port Mapper Daemon (epmd),
|
|
which acts as a name server on all hosts involved in distributed
|
|
Erlang computations.
|
|
'';
|
|
};
|
|
package = mkPackageOption pkgs "erlang" { };
|
|
listenStream = mkOption
|
|
{
|
|
type = types.str;
|
|
default = "[::]:4369";
|
|
description = ''
|
|
the listenStream used by the systemd socket.
|
|
see https://www.freedesktop.org/software/systemd/man/systemd.socket.html#ListenStream= for more information.
|
|
use this to change the port epmd will run on.
|
|
if not defined, epmd will use "[::]:4369"
|
|
'';
|
|
};
|
|
};
|
|
|
|
###### implementation
|
|
config = mkIf cfg.enable {
|
|
assertions = [{
|
|
assertion = cfg.listenStream == "[::]:4369" -> config.networking.enableIPv6;
|
|
message = "epmd listens by default on ipv6, enable ipv6 or change config.services.epmd.listenStream";
|
|
}];
|
|
systemd.sockets.epmd = rec {
|
|
description = "Erlang Port Mapper Daemon Activation Socket";
|
|
wantedBy = [ "sockets.target" ];
|
|
before = wantedBy;
|
|
socketConfig = {
|
|
ListenStream = cfg.listenStream;
|
|
Accept = "false";
|
|
};
|
|
};
|
|
|
|
systemd.services.epmd = {
|
|
description = "Erlang Port Mapper Daemon";
|
|
after = [ "network.target" ];
|
|
requires = [ "epmd.socket" ];
|
|
|
|
serviceConfig = {
|
|
DynamicUser = true;
|
|
ExecStart = "${cfg.package}/bin/epmd -systemd";
|
|
Type = "notify";
|
|
};
|
|
};
|
|
};
|
|
|
|
meta.maintainers = teams.beam.members;
|
|
}
|