2024-12-12 14:41:43 +01:00
|
|
|
# SPDX-FileCopyrightText: 2024 Tom Hubrecht <tom.hubrecht@dgnum.eu>
|
|
|
|
# SPDX-FileContributor: Maurice Debray <maurice.debray@dgnum.eu>
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: EUPL-1.2
|
|
|
|
|
2024-03-13 11:24:27 +01:00
|
|
|
# Nix expression to check if meta module is evaluating correctly.
|
|
|
|
# To do so run `nix-build ./verify.nix`
|
2024-02-23 10:50:50 +01:00
|
|
|
let
|
|
|
|
sources = import ../npins;
|
|
|
|
pkgs = import sources.nixpkgs { };
|
2024-03-29 14:37:21 +01:00
|
|
|
|
2024-09-20 23:36:49 +02:00
|
|
|
dns = import sources."dns.nix" { inherit pkgs; };
|
2024-02-23 10:50:50 +01:00
|
|
|
in
|
|
|
|
|
2024-03-29 14:37:21 +01:00
|
|
|
{
|
2024-05-14 23:31:49 +02:00
|
|
|
meta =
|
|
|
|
let
|
|
|
|
config = (import ./.) pkgs.lib;
|
|
|
|
failed = builtins.map (x: "- ${x.message}") (builtins.filter (x: !x.assertion) config.assertions);
|
|
|
|
in
|
|
|
|
if (failed != [ ]) then
|
|
|
|
throw ''
|
2024-05-15 09:58:50 +02:00
|
|
|
|
2024-05-14 23:31:49 +02:00
|
|
|
Failed assertions:
|
|
|
|
${builtins.concatStringsSep "\n" failed}
|
|
|
|
''
|
|
|
|
else
|
|
|
|
pkgs.writers.writeJSON "meta.json" config;
|
2024-03-29 14:37:21 +01:00
|
|
|
|
2024-09-20 23:36:49 +02:00
|
|
|
dns = dns.util.writeZone "dgnum.eu" (
|
2024-10-09 17:04:30 +02:00
|
|
|
pkgs.lib.recursiveUpdate { SOA.serial = 0; } (
|
|
|
|
import ./dns.nix {
|
|
|
|
inherit dns;
|
|
|
|
|
|
|
|
lib = pkgs.lib // {
|
|
|
|
extra = import ../lib/nix-lib;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
)
|
2024-03-29 14:37:21 +01:00
|
|
|
);
|
|
|
|
}
|