From 5b0f56d6557df71c1da7e9ab6feaeda791d0183d Mon Sep 17 00:00:00 2001 From: Vika Date: Sat, 22 Jul 2023 19:24:20 +0300 Subject: configuration.nix: use NixOS option for ListenStream --- configuration.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'configuration.nix') diff --git a/configuration.nix b/configuration.nix index e51cefd..a47d7db 100644 --- a/configuration.nix +++ b/configuration.nix @@ -122,12 +122,11 @@ in { wantedBy = [ "sockets.target" ]; restartTriggers = [ cfg.bind cfg.port ]; - + listenStreams = lib.mkMerge [ + [ (lib.mkIf (cfg.bind == null) (builtins.toString cfg.port)) ] + [ (lib.mkIf (cfg.bind != null) "${cfg.bind}:${builtins.toString cfg.port}") ] + ]; socketConfig = { - ListenStream = lib.mkMerge [ - (lib.mkIf (cfg.bind == null) cfg.port) - (lib.mkIf (cfg.bind != null) "${cfg.bind}:${builtins.toString cfg.port}") - ]; BindIPv6Only = true; }; }; -- cgit 1.4.1