about summary refs log tree commit diff
path: root/ops/dns/default.nix
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2021-03-15T22·02+0100
committersterni <sternenseemann@systemli.org>2021-03-15T22·16+0000
commitc32e8424be3257a6ad3f913aa923989a5c0a40ba (patch)
tree018612f3ae7875981ac215006aae31b78b222433 /ops/dns/default.nix
parent5d8490d2fc7a735f747704792d4fc7d779d6e471 (diff)
refactor(ops/dns): use drvTargets for meta.targets population r/2283
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 <mail@tazj.in>
Diffstat (limited to 'ops/dns/default.nix')
-rw-r--r--ops/dns/default.nix15
1 files changed, 8 insertions, 7 deletions
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;
 }