From c32e8424be3257a6ad3f913aa923989a5c0a40ba Mon Sep 17 00:00:00 2001 From: sterni Date: Mon, 15 Mar 2021 23:02:07 +0100 Subject: refactor(ops/dns): use drvTargets for meta.targets population Since we have a dedicated util for this, we may as well use it to reduce code duplication. Change-Id: Ie52647be8c786d0b6a4dceb2fa6778b94625fafc Reviewed-on: https://cl.tvl.fyi/c/depot/+/2604 Tested-by: BuildkiteCI Reviewed-by: tazjin --- ops/dns/default.nix | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'ops') diff --git a/ops/dns/default.nix b/ops/dns/default.nix index 58af7aa6f24d..be78702809ef 100644 --- a/ops/dns/default.nix +++ b/ops/dns/default.nix @@ -1,15 +1,16 @@ # Performs simple (local-only) validity checks on DNS zones. -{ pkgs, ... }: +{ depot, pkgs, ... }: let + inherit (depot.nix.utils) + drvTargets + ; + checkZone = zone: file: pkgs.runCommandNoCC "${zone}-check" {} '' ${pkgs.bind}/bin/named-checkzone -i local ${zone} ${file} | tee $out ''; - zones = { - tvl-fyi = checkZone "tvl.fyi" ./tvl.fyi.zone; - tvl-su = checkZone "tvl.su" ./tvl.su.zone; - }; -in zones // { - meta.targets = builtins.attrNames zones; +in drvTargets { + tvl-fyi = checkZone "tvl.fyi" ./tvl.fyi.zone; + tvl-su = checkZone "tvl.su" ./tvl.su.zone; } -- cgit 1.4.1