For my headscale service definition, I’d like to run a check on the acl.json policy file at build time, what is the best way to do so? I currently add to environment.systemPackages a stub package that calls headscale policy check -f, but this seems clunky:
environment.systemPackages = [
(pkgs.stdenv.mkDerivation {
name = "headscale-check-acl";
src = ./acl.json;
phases = [
"installPhase"
"checkPhase"
];
installPhase = ''
install -D $src $out/acl.json
'';
doCheck = true;
checkPhase = ''
${config.services.headscale.package}/bin/headscale policy check -f $out/acl.json
'';
})
];