Commit 4aad2537e76e
Changed files (2)
tools/show-dns.sh
@@ -181,7 +181,7 @@ failed_zones=0
for zone_name in "${ZONES[@]}"; do
# Get the zone file content directly
- zone_content=$(nix eval --raw ".#nixosConfigurations.${HOST}.config.services.bind.zones.\"${zone_name}\".file" 2>&1 | grep -v "^warning:" | grep -v "^Using saved setting" || true)
+ zone_content=$(nix eval --raw ".#nixosConfigurations.${HOST}.config.services.bind.zones.\"${zone_name}\".file" --apply 'path: builtins.readFile path' 2>&1 | grep -v "^warning:" | grep -v "^Using saved setting" | grep -v "^building " || true)
if [[ -n "$zone_content" ]] && [[ "$zone_content" != *"error"* ]]; then
total_zones=$((total_zones + 1))
tools/update-gandi-dns.sh
@@ -44,8 +44,8 @@ echo
# Get the DNS zone file content from Nix
echo -e "${CYAN}Extracting DNS records from Nix configuration...${RESET}"
-ZONE_FILE=$(nix eval --raw '.#nixosConfigurations.demeter.config.services.bind.zones."sbr.pm".file' 2>&1 | \
- grep -v "^warning:" | grep -v "^Using saved setting")
+ZONE_FILE=$(nix eval --raw '.#nixosConfigurations.demeter.config.services.bind.zones."sbr.pm".file' --apply 'path: builtins.readFile path' 2>&1 | \
+ grep -v "^warning:" | grep -v "^Using saved setting" | grep -v "^building ")
if [[ -z "$ZONE_FILE" ]]; then
echo -e "${RED}Error: Could not generate zone file${RESET}"