From e3c0989d4ac621d2850683d192c9e37ef0748753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kry=C5=A1tof=20Baksa?= <62813600+Golbinex@users.noreply.github.com> Date: Tue, 9 Jun 2026 12:34:35 +0200 Subject: [PATCH 1/2] nixos/adguardhome: Use lib.recursiveUpdate --- nixos/modules/services/networking/adguardhome.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nixos/modules/services/networking/adguardhome.nix b/nixos/modules/services/networking/adguardhome.nix index caab4ba0c953..d05f2de93fcc 100644 --- a/nixos/modules/services/networking/adguardhome.nix +++ b/nixos/modules/services/networking/adguardhome.nix @@ -20,8 +20,7 @@ let settings = if (cfg.settings != null) then - cfg.settings - // ( + lib.recursiveUpdate cfg.settings ( if cfg.settings.schema_version < 23 then { bind_host = cfg.host; From 35b0754ae7c9095d0e16220a2d82597bbfd69b3d Mon Sep 17 00:00:00 2001 From: Golbinex <2061409-Golbinex@users.noreply.gitlab.com> Date: Mon, 26 Jan 2026 10:32:01 +0100 Subject: [PATCH 2/2] nixos/adguardhome: Fix protection_disabled_until value --- nixos/modules/services/networking/adguardhome.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/networking/adguardhome.nix b/nixos/modules/services/networking/adguardhome.nix index d05f2de93fcc..5d6c4459aa8e 100644 --- a/nixos/modules/services/networking/adguardhome.nix +++ b/nixos/modules/services/networking/adguardhome.nix @@ -191,8 +191,9 @@ in # Note: --check-config has the side effect of modifying the file at rest! ${lib.getExe cfg.package} -c "$STATE_DIRECTORY/AdGuardHome.yaml" --check-config - # Writing directly to AdGuardHome.yaml results in empty file - ${lib.getExe pkgs.yaml-merge} "$STATE_DIRECTORY/AdGuardHome.yaml" "${configFile}" > "$STATE_DIRECTORY/AdGuardHome.yaml.tmp" + # sed operation needed to fix protection_disabled_until value changed by yaml-merge + ${lib.getExe pkgs.yaml-merge} "$STATE_DIRECTORY/AdGuardHome.yaml" "${configFile}" \ + | sed -E "s/(protection_disabled_until: [0-9]{4}-[0-9]{2}-[0-9]{2}) /\1T/" > "$STATE_DIRECTORY/AdGuardHome.yaml.tmp" mv "$STATE_DIRECTORY/AdGuardHome.yaml.tmp" "$STATE_DIRECTORY/AdGuardHome.yaml" else ${installFresh}