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 <mail@tazj.in>
This commit is contained in:
parent
5d8490d2fc
commit
c32e8424be
1 changed files with 8 additions and 7 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue