Files
nixpkgs/pkgs/by-name/xr/xray/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

68 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 = "25.9.11";
src = fetchFromGitHub {
owner = "XTLS";
repo = "Xray-core";
rev = "v${version}";
hash = "sha256-498Kf+V2g2i0hpQy+vAEzf3hVoPUAWfUyWcJmP3Bgb4=";
};
vendorHash = "sha256-xhd4KGHGA82gacugM6rgYAz8gVdGWu0LHEiLeRnx3xQ=";
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 ];
};
}