about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorElliot <hack00mind@gmail.com>2022-12-06 23:32:04 +0800
committerElliot <hack00mind@gmail.com>2022-12-11 22:23:12 +0800
commit08d651764f5955acd3800c65bff4934762dd2f41 (patch)
tree3124397a6572b69a48439a9e8a05e94eb4afa0b3 /nixos
parent7af4851db55a30c7ade3a2acad030b6083ac5469 (diff)
v2raya: init at 2.0.0
Update nixos/modules/services/networking/v2raya.nix

Co-authored-by: zendo <linzway@qq.com>

Update nixos/modules/services/networking/v2raya.nix

Co-authored-by: zendo <linzway@qq.com>

Update pkgs/tools/networking/v2raya/default.nix

Co-authored-by: zendo <linzway@qq.com>

Update pkgs/tools/networking/v2raya/default.nix

Co-authored-by: zendo <linzway@qq.com>

Update nixos/modules/services/networking/v2raya.nix

Co-authored-by: zendo <linzway@qq.com>

Update pkgs/tools/networking/v2raya/default.nix

Co-authored-by: zendo <linzway@qq.com>

Update nixos/modules/services/networking/v2raya.nix

Co-authored-by: zendo <linzway@qq.com>
Diffstat (limited to 'nixos')
-rw-r--r--nixos/doc/manual/from_md/release-notes/rl-2305.section.xml8
-rw-r--r--nixos/doc/manual/release-notes/rl-2305.section.md2
-rw-r--r--nixos/modules/module-list.nix1
-rw-r--r--nixos/modules/services/networking/v2raya.nix39
4 files changed, 50 insertions, 0 deletions
diff --git a/nixos/doc/manual/from_md/release-notes/rl-2305.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2305.section.xml
index 61daeac86a64d..f072418d8506c 100644
--- a/nixos/doc/manual/from_md/release-notes/rl-2305.section.xml
+++ b/nixos/doc/manual/from_md/release-notes/rl-2305.section.xml
@@ -37,6 +37,14 @@
           <link linkend="opt-programs.fzf.fuzzyCompletion">programs.fzf</link>.
         </para>
       </listitem>
+      <listitem>
+        <para>
+          <link xlink:href="https://v2raya.org">v2rayA</link>, a Linux
+          web GUI client of Project V which supports V2Ray, Xray, SS,
+          SSR, Trojan and Pingtunnel. Available as
+          <link xlink:href="options.html#opt-services.v2raya.enable">services.v2raya</link>.
+        </para>
+      </listitem>
     </itemizedlist>
   </section>
   <section xml:id="sec-release-23.05-incompatibilities">
diff --git a/nixos/doc/manual/release-notes/rl-2305.section.md b/nixos/doc/manual/release-notes/rl-2305.section.md
index f9c76b02f891c..f12466faafc8d 100644
--- a/nixos/doc/manual/release-notes/rl-2305.section.md
+++ b/nixos/doc/manual/release-notes/rl-2305.section.md
@@ -18,6 +18,8 @@ In addition to numerous new and upgraded packages, this release has the followin
 
 - [fzf](https://github.com/junegunn/fzf), a command line fuzzyfinder. Available as [programs.fzf](#opt-programs.fzf.fuzzyCompletion).
 
+- [v2rayA](https://v2raya.org), a Linux web GUI client of Project V which supports V2Ray, Xray, SS, SSR, Trojan and Pingtunnel. Available as [services.v2raya](options.html#opt-services.v2raya.enable).
+
 ## Backward Incompatibilities {#sec-release-23.05-incompatibilities}
 
 <!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index 24dd30e157501..842797d24302c 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -997,6 +997,7 @@
   ./services/video/rtsp-simple-server.nix
   ./services/networking/uptermd.nix
   ./services/networking/v2ray.nix
+  ./services/networking/v2raya.nix
   ./services/networking/vdirsyncer.nix
   ./services/networking/vsftpd.nix
   ./services/networking/wasabibackend.nix
diff --git a/nixos/modules/services/networking/v2raya.nix b/nixos/modules/services/networking/v2raya.nix
new file mode 100644
index 0000000000000..2d697b4fb56f3
--- /dev/null
+++ b/nixos/modules/services/networking/v2raya.nix
@@ -0,0 +1,39 @@
+{ config, pkgs, lib, ... }:
+
+with lib;
+
+{
+  options = {
+    services.v2raya = {
+      enable = options.mkEnableOption (mdDoc "the v2rayA service");
+    };
+  };
+
+  config = mkIf config.services.v2raya.enable {
+    environment.systemPackages = [ pkgs.v2raya ];
+
+    systemd.services.v2raya = {
+      unitConfig = {
+        Description = "v2rayA service";
+        Documentation = "https://github.com/v2rayA/v2rayA/wiki";
+        After = [ "network.target" "nss-lookup.target" "iptables.service" "ip6tables.service" ];
+        Wants = [ "network.target" ];
+      };
+
+      serviceConfig = {
+        User = "root";
+        ExecStart = "${getExe pkgs.v2raya} --log-disable-timestamp";
+        Environment = [ "V2RAYA_LOG_FILE=/var/log/v2raya/v2raya.log" ];
+        LimitNPROC = 500;
+        LimitNOFILE = 1000000;
+        Restart = "on-failure";
+        Type = "simple";
+      };
+
+      wantedBy = [ "multi-user.target" ];
+      path = with pkgs; [ iptables bash iproute2 ]; # required by v2rayA TProxy functionality
+    };
+  };
+
+  meta.maintainers = with maintainers; [ elliot ];
+}