about summary refs log tree commit diff
path: root/nixos/modules/services/networking/v2ray.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/services/networking/v2ray.nix')
-rw-r--r--nixos/modules/services/networking/v2ray.nix8
1 files changed, 7 insertions, 1 deletions
diff --git a/nixos/modules/services/networking/v2ray.nix b/nixos/modules/services/networking/v2ray.nix
index a1774cdffbb9..6a924a16449a 100644
--- a/nixos/modules/services/networking/v2ray.nix
+++ b/nixos/modules/services/networking/v2ray.nix
@@ -58,7 +58,13 @@ with lib;
     cfg = config.services.v2ray;
     configFile = if cfg.configFile != null
       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 {
     assertions = [