nixos/jool: validate the configuration
This checks the validity of both NAT64 and SIIT configurations at build time. An error produces something like this: Validating Jool configuration... Error: Cannot parse '283.0.113.1' as an IPv4 address.
This commit is contained in:
parent
41934b580a
commit
1f28c8defc
1 changed files with 11 additions and 0 deletions
|
@ -201,6 +201,17 @@ in
|
|||
} // hardening;
|
||||
};
|
||||
|
||||
system.checks = lib.singleton (pkgs.runCommand "jool-validated" {
|
||||
nativeBuildInputs = [ pkgs.buildPackages.jool-cli ];
|
||||
preferLocalBuild = true;
|
||||
} ''
|
||||
printf 'Validating Jool configuration... '
|
||||
${lib.optionalString cfg.siit.enable "jool_siit file check ${siitConf}"}
|
||||
${lib.optionalString cfg.nat64.enable "jool file check ${nat64Conf}"}
|
||||
printf 'ok\n'
|
||||
touch "$out"
|
||||
'');
|
||||
|
||||
networking.jool.nat64.config = mkDefaultAttrs defaultNat64;
|
||||
networking.jool.siit.config = mkDefaultAttrs defaultSiit;
|
||||
|
||||
|
|
Loading…
Reference in a new issue