python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / tools / networking / xray / default.nix
blobbe95d26fa34f9c985b523658ba78c3070f8e30e9
1 { lib
2 , fetchFromGitHub
3 , fetchurl
4 , symlinkJoin
5 , buildGoModule
6 , runCommand
7 , makeWrapper
8 , nix-update-script
9 , v2ray-geoip
10 , v2ray-domain-list-community
11 , assets ? [ v2ray-geoip v2ray-domain-list-community ]
14 let
15   assetsDrv = symlinkJoin {
16     name = "v2ray-assets";
17     paths = assets;
18   };
21 buildGoModule rec {
22   pname = "xray";
23   version = "1.6.1";
25   src = fetchFromGitHub {
26     owner = "XTLS";
27     repo = "Xray-core";
28     rev = "v${version}";
29     sha256 = "0g2bmy522lhip0rgb3hqyi3bidf4ljyjvvv3n1kb6lvm0p3br51b";
30   };
32   vendorSha256 = "sha256-QAF/05/5toP31a/l7mTIetFhXuAKsT69OI1K/gMXei0=";
34   nativeBuildInputs = [ makeWrapper ];
36   doCheck = false;
38   ldflags = [ "-s" "-w" "-buildid=" ];
39   subPackages = [ "main" ];
41    installPhase = ''
42     runHook preInstall
43     install -Dm555 "$GOPATH"/bin/main $out/bin/xray
44     runHook postInstall
45   '';
47   assetsDrv = symlinkJoin {
48     name = "v2ray-assets";
49     paths = assets;
50   };
52   postFixup = ''
53     wrapProgram $out/bin/xray \
54       --suffix XRAY_LOCATION_ASSET : $assetsDrv/share/v2ray
55   '';
57   passthru = {
58     updateScript = nix-update-script {
59       attrPath = pname;
60     };
61   };
63   meta = {
64     description = "A platform for building proxies to bypass network restrictions. A replacement for v2ray-core, with XTLS support and fully compatible configuration";
65     homepage = "https://github.com/XTLS/Xray-core";
66     license = with lib.licenses; [ mpl20 ];
67     maintainers = with lib.maintainers; [ iopq ];
68   };