systemd.sockets: Add listenStreams option for specifying several sockets
This commit is contained in:
parent
a29c306958
commit
70586f03fe
@ -215,6 +215,16 @@ rec {
|
|||||||
|
|
||||||
socketOptions = unitOptions // {
|
socketOptions = unitOptions // {
|
||||||
|
|
||||||
|
listenStreams = mkOption {
|
||||||
|
default = [];
|
||||||
|
types = types.listOf types.string;
|
||||||
|
example = [ "0.0.0.0:993" "/run/my-socket" ];
|
||||||
|
description = ''
|
||||||
|
For each item in this list, a <literal>ListenStream</literal>
|
||||||
|
option in the <literal>[Socket]</literal> section will be created.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
socketConfig = mkOption {
|
socketConfig = mkOption {
|
||||||
default = {};
|
default = {};
|
||||||
example = { ListenStream = "/run/my-socket"; };
|
example = { ListenStream = "/run/my-socket"; };
|
||||||
|
@ -275,6 +275,7 @@ let
|
|||||||
|
|
||||||
[Socket]
|
[Socket]
|
||||||
${attrsToSection def.socketConfig}
|
${attrsToSection def.socketConfig}
|
||||||
|
${concatStringsSep "\n" (map (s: "ListenStream=${s}") def.listenStreams)}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user