nixos/adguardhome: Fix protection_disabled_until value

This commit is contained in:
Golbinex
2026-01-26 10:32:01 +01:00
parent e3c0989d4a
commit 35b0754ae7

View File

@@ -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}