git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/systemd: Add support for `listenDatagrams`

This works exactly analogously to the existing `listenStreams`.

commit70d68f04787d0e168723000946368ad110db6476 authorJohn Ericson <git@JohnEricson.me> dateTue 11 Aug 2020, 17:46 (6 years ago) parent4d9dec0
2 files changed+11
nixos/modules/system/boot/systemd-unit-options.nix+10 nixos/modules/system/boot/systemd.nix+1
nixos/modules/system/boot/systemd-unit-options.nix+10
@@ -379,6 +379,16 @@ in rec {
379379 '';
380380 };
381381
382+ listenDatagrams = mkOption {
383+ default = [];
384+ type = types.listOf types.str;
385+ example = [ "0.0.0.0:993" "/run/my-socket" ];
386+ description = ''
387+ For each item in this list, a <literal>ListenDatagram</literal>
388+ option in the <literal>[Socket]</literal> section will be created.
389+ '';
390+ };
391+
382392 socketConfig = mkOption {
383393 default = {};
384394 example = { ListenStream = "/run/my-socket"; };
nixos/modules/system/boot/systemd.nix+1
@@ -354,6 +354,7 @@ let
354354 [Socket]
355355 ${attrsToSection def.socketConfig}
356356 ${concatStringsSep "\n" (map (s: "ListenStream=${s}") def.listenStreams)}
357+ ${concatStringsSep "\n" (map (s: "ListenDatagram=${s}") def.listenDatagrams)}
357358 '';
358359 };
359360