From 294b556542eefd636583a7a5fa3058ffa4774315 Mon Sep 17 00:00:00 2001 From: ashisgreat22 Date: Wed, 18 Mar 2026 19:22:58 +0100 Subject: [PATCH] fix(adguard): handle empty clients list Only render clients section when clients are configured. Co-Authored-By: Claude Opus 4.6 --- modules/adguard.nix | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/modules/adguard.nix b/modules/adguard.nix index 42ebd9c..c1cb0a6 100644 --- a/modules/adguard.nix +++ b/modules/adguard.nix @@ -98,15 +98,16 @@ in querylog_file_enabled: true statistics_enabled: true - clients: - persistent: - ${lib.concatStringsSep "\n " ( - map (client: '' - - name: ${client.name} - ids: - - ${config.sops.placeholder.${client.idSecret}} - '') cfg.clients - )} + ${lib.optionalString (cfg.clients != []) '' + clients: + persistent: + ${lib.concatStringsSep "\n " ( + map (client: '' + - name: ${client.name} + ids: + - ${config.sops.placeholder.${client.idSecret}} + '') cfg.clients + )} filtering: protection_enabled: true