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>
This commit is contained in:
Elliot 2022-12-06 23:32:04 +08:00
parent 7af4851db5
commit 08d651764f
No known key found for this signature in database
GPG key ID: FF4A3BC47FACBC66
9 changed files with 19657 additions and 0 deletions

View file

@ -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">

View file

@ -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. -->

View file

@ -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

View file

@ -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 ];
}

View file

@ -0,0 +1,71 @@
{ lib
, fetchFromGitHub
, mkYarnPackage
, buildGoModule
, makeWrapper
, v2ray
, v2ray-geoip
, v2ray-domain-list-community
, symlinkJoin
}:
let
pname = "v2raya";
version = "2.0.0";
src = fetchFromGitHub {
owner = "v2rayA";
repo = "v2rayA";
rev = "v${version}";
sha256 = "sha256-1fWcrMd+TSrlS1H0z7XwVCQzZAa8DAFtlekEZNRMAPA=";
};
web = mkYarnPackage {
inherit pname version;
src = "${src}/gui";
yarnNix = ./yarn.nix;
packageJSON = ./package.json;
yarnLock = ./yarn.lock;
buildPhase = ''
export NODE_OPTIONS=--openssl-legacy-provider
ln -s $src/postcss.config.js postcss.config.js
OUTPUT_DIR=$out yarn --offline build
'';
distPhase = "true";
dontInstall = true;
dontFixup = true;
};
in
buildGoModule {
inherit pname version;
src = "${src}/service";
vendorSha256 = "sha256-Ud4pwS0lz7zSTowg3gXNllfDyj8fu33H1L20szxPcOA=";
ldflags = [
"-s"
"-w"
"-X github.com/v2rayA/v2rayA/conf.Version=${version}"
];
subPackages = [ "." ];
nativeBuildInputs = [ makeWrapper ];
preBuild = ''
cp -a ${web} server/router/web
'';
postInstall = ''
install -Dm 444 ${src}/install/universal/v2raya.desktop -t $out/share/applications
install -Dm 444 ${src}/install/universal/v2raya.png -t $out/share/icons/hicolor/512x512/apps
substituteInPlace $out/share/applications/v2raya.desktop \
--replace 'Icon=/usr/share/icons/hicolor/512x512/apps/v2raya.png' 'Icon=v2raya'
wrapProgram $out/bin/v2rayA \
--prefix PATH ":" "${lib.makeBinPath [ v2ray ]}" \
--prefix XDG_DATA_DIRS ":" ${symlinkJoin {
name = "assets";
paths = [ v2ray-geoip v2ray-domain-list-community ];
}}/share
'';
meta = with lib; {
description = "A Linux web GUI client of Project V which supports V2Ray, Xray, SS, SSR, Trojan and Pingtunnel";
homepage = "https://github.com/v2rayA/v2rayA";
mainProgram = "v2rayA";
license = licenses.agpl3Only;
platforms = platforms.linux;
maintainers = with maintainers; [ elliot ];
};
}

View file

@ -0,0 +1,52 @@
{
"name": "v2raya",
"version": "0.1.0",
"private": true,
"license": "GPL-3.0",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"@mdi/font": "^5.8.55",
"@nuintun/qrcode": "^3.3.0",
"@vue/babel-preset-app": "^4.2.2",
"axios": "^0.21.1",
"buefy": "0.9.3",
"clipboard": "^2.0.4",
"dayjs": "^1.10.6",
"js-base64": "^2.5.1",
"nanoid": "^3.1.23",
"normalize.css": "^8.0.1",
"pace-js": "^1.2.4",
"qrcode": "^1.4.2",
"register-service-worker": "^1.6.2",
"uglifyjs-webpack-plugin": "^1.1.1",
"vue": "^2.6.10",
"vue-i18n": "^8.15.3",
"vue-router": "^3.0.6",
"vue-virtual-scroller": "^1.0.10",
"vuex": "^3.0.1",
"webpack-iconfont-plugin-nodejs": "^1.0.16"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.2.2",
"@vue/cli-plugin-eslint": "^4.0.5",
"@vue/cli-plugin-router": "^4.0.0",
"@vue/cli-plugin-vuex": "^4.0.0",
"@vue/cli-service": "^4.0.0",
"@vue/eslint-config-prettier": "^5.0.0",
"babel-eslint": "^10.0.3",
"css-loader": "^5.2.0",
"eslint": "^5.16.0",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-vue": "^5.0.0",
"highlight.js": "^11.4.0",
"prettier": "^1.18.2",
"sass": "^1.19.0",
"sass-loader": "^8.0.0",
"urijs": "^1.19.11",
"vue-template-compiler": "^2.6.10"
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -12562,6 +12562,8 @@ with pkgs;
v2ray = callPackage ../tools/networking/v2ray { };
v2raya = callPackage ../tools/networking/v2raya { };
v2ray-domain-list-community = callPackage ../data/misc/v2ray-domain-list-community { };
v2ray-geoip = callPackage ../data/misc/v2ray-geoip { };