1
0
Fork 0
forked from DGNum/lab-infra
lab-infra/meta/verify.nix
sinavir 2ac0a35c5e chore(meta): Revamp and remove DNS for now
We don't have a dns server for the lab infra for now. Later we will
probably reintroduce the tooling for our dns server. This will be good
for people to get into understanding the main infra repository.
2024-10-17 13:36:27 +02:00

23 lines
539 B
Nix

# Nix expression to check if meta module is evaluating correctly.
# To do so run `nix-build ./verify.nix`
let
sources = import ../npins;
pkgs = import sources.nixpkgs { };
in
{
meta =
let
config = (import ./.) pkgs.lib;
failed = builtins.map (x: "- ${x.message}") (builtins.filter (x: !x.assertion) config.assertions);
in
if (failed != [ ]) then
throw ''
Failed assertions:
${builtins.concatStringsSep "\n" failed}
''
else
pkgs.writers.writeJSON "meta.json" config;
}