nixos/systemd: Add support for listenDatagrams
This works exactly analogously to the existing `listenStreams`.
This commit is contained in:
parent
4d9dec0aba
commit
70d68f0478
@ -379,6 +379,16 @@ in rec {
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
listenDatagrams = mkOption {
|
||||||
|
default = [];
|
||||||
|
type = types.listOf types.str;
|
||||||
|
example = [ "0.0.0.0:993" "/run/my-socket" ];
|
||||||
|
description = ''
|
||||||
|
For each item in this list, a <literal>ListenDatagram</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"; };
|
||||||
|
@ -354,6 +354,7 @@ let
|
|||||||
[Socket]
|
[Socket]
|
||||||
${attrsToSection def.socketConfig}
|
${attrsToSection def.socketConfig}
|
||||||
${concatStringsSep "\n" (map (s: "ListenStream=${s}") def.listenStreams)}
|
${concatStringsSep "\n" (map (s: "ListenStream=${s}") def.listenStreams)}
|
||||||
|
${concatStringsSep "\n" (map (s: "ListenDatagram=${s}") def.listenDatagrams)}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user