nixpkgs/pkgs/tools/networking/xray/default.nix
Alexis Hildebrandt 755b915a15 treewide: Remove indefinite article from meta.description
nix run nixpkgs#silver-searcher -- -G '\.nix$' -0l 'description.*"[Aa]n?' pkgs \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee 's/(description.*")[Aa]n? (.)/\1\U\2/'
2024-06-09 23:07:45 +02:00

61 lines
1.4 KiB
Nix

{ lib
, fetchFromGitHub
, symlinkJoin
, buildGoModule
, makeWrapper
, nix-update-script
, v2ray-geoip
, v2ray-domain-list-community
, assets ? [ v2ray-geoip v2ray-domain-list-community ]
}:
buildGoModule rec {
pname = "xray";
version = "1.8.13";
src = fetchFromGitHub {
owner = "XTLS";
repo = "Xray-core";
rev = "v${version}";
hash = "sha256-+npmj8Cz3/XTabAXL+J02EmyvPwtwz9TKazd9z9emwI=";
};
vendorHash = "sha256-55mNCD3p6Xy6S1w8WzJwxKttjEkEjJZcGTLQdWl1bQQ=";
nativeBuildInputs = [ makeWrapper ];
doCheck = false;
ldflags = [ "-s" "-w" ];
subPackages = [ "main" ];
installPhase = ''
runHook preInstall
install -Dm555 "$GOPATH"/bin/main $out/bin/xray
runHook postInstall
'';
assetsDrv = symlinkJoin {
name = "v2ray-assets";
paths = assets;
};
postFixup = ''
wrapProgram $out/bin/xray \
--set-default V2RAY_LOCATION_ASSET $assetsDrv/share/v2ray \
--set-default XRAY_LOCATION_ASSET $assetsDrv/share/v2ray
'';
passthru = {
updateScript = nix-update-script { };
};
meta = {
description = "Platform for building proxies to bypass network restrictions. A replacement for v2ray-core, with XTLS support and fully compatible configuration";
mainProgram = "xray";
homepage = "https://github.com/XTLS/Xray-core";
license = with lib.licenses; [ mpl20 ];
maintainers = with lib.maintainers; [ iopq ];
};
}