nixos/services.epmd: remove with lib;

This commit is contained in:
Felix Buehler 2024-08-28 21:19:06 +02:00 committed by Jörg Thalheim
parent a09250d8ab
commit 6233a59db3

View File

@ -1,15 +1,12 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.epmd;
in
{
###### interface
options.services.epmd = {
enable = mkOption {
type = types.bool;
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Whether to enable socket activation for Erlang Port Mapper Daemon (epmd),
@ -17,10 +14,10 @@ in
Erlang computations.
'';
};
package = mkPackageOption pkgs "erlang" { };
listenStream = mkOption
package = lib.mkPackageOption pkgs "erlang" { };
listenStream = lib.mkOption
{
type = types.str;
type = lib.types.str;
default = "[::]:4369";
description = ''
the listenStream used by the systemd socket.
@ -32,7 +29,7 @@ in
};
###### implementation
config = mkIf cfg.enable {
config = lib.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";
@ -60,5 +57,5 @@ in
};
};
meta.maintainers = teams.beam.members;
meta.maintainers = lib.teams.beam.members;
}