mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
Merge pull request #83307 from servalcatty/fix/v2ray-check
nixos/v2ray: check v2ray config during the build time
This commit is contained in:
commit
c9d9ba0f7b
1 changed files with 7 additions and 1 deletions
|
@ -58,7 +58,13 @@ with lib;
|
||||||
cfg = config.services.v2ray;
|
cfg = config.services.v2ray;
|
||||||
configFile = if cfg.configFile != null
|
configFile = if cfg.configFile != null
|
||||||
then cfg.configFile
|
then cfg.configFile
|
||||||
else (pkgs.writeText "v2ray.json" (builtins.toJSON cfg.config));
|
else pkgs.writeTextFile {
|
||||||
|
name = "v2ray.json";
|
||||||
|
text = builtins.toJSON cfg.config;
|
||||||
|
checkPhase = ''
|
||||||
|
${pkgs.v2ray}/bin/v2ray -test -config $out
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
in mkIf cfg.enable {
|
in mkIf cfg.enable {
|
||||||
assertions = [
|
assertions = [
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue