summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorServal <servalcat@pm.me>2020-03-25 01:51:56 +0800
committerServal <servalcat@pm.me>2020-03-25 01:51:56 +0800
commit75afd2fc344ec506f12476c26a23d55192c5075d (patch)
treef8f0d62d789e3ffdf6f7e1b6a4e54a96dfa761df /nixos
parentd96bd3394b734487d1c3bfbac0e8f17465e03afe (diff)
downloadnixpkgs-75afd2fc344ec506f12476c26a23d55192c5075d.tar
nixpkgs-75afd2fc344ec506f12476c26a23d55192c5075d.tar.gz
nixpkgs-75afd2fc344ec506f12476c26a23d55192c5075d.tar.bz2
nixpkgs-75afd2fc344ec506f12476c26a23d55192c5075d.tar.lz
nixpkgs-75afd2fc344ec506f12476c26a23d55192c5075d.tar.xz
nixpkgs-75afd2fc344ec506f12476c26a23d55192c5075d.tar.zst
nixpkgs-75afd2fc344ec506f12476c26a23d55192c5075d.zip
nixos/v2ray: check v2ray config during the build time
Diffstat (limited to 'nixos')
-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 a1774cdffbb..6a924a16449 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 = [