feat: better inbounds user management

This commit is contained in:
FUFSoB committed 2026-10-14 21:41:49 +05:00
1 parent 2f8414455d
commit 9f7ad91f39
47 files changed
+6767 -78

No files matched your search

+29 -19
View File
@@ -1,27 +1,37 @@
# Xray-core ahead of nixpkgs, which still ships 26.3.27. From 26.9.8 its go.mod
# asks for Go 1.27, so the builder is swapped along with the source. Steps
# aside once nixpkgs has caught up.
# aside once nixpkgs has caught up; the patch stays.
#
# The patch marks an outbound's sockets by the level of the inbound user they dial for
# (inbounds.manager's speed limits); passthru.userLevelMark says it is in.
{ pkgs }:
let
inherit (pkgs) lib;
version = "26.10.10";
base =
if lib.versionAtLeast pkgs.xray.version version then
pkgs.xray
else
(pkgs.xray.override (
args: lib.optionalAttrs (args ? buildGo126Module) { buildGo126Module = pkgs.buildGo127Module; }
)).overrideAttrs
(
finalAttrs: _: {
inherit version;
src = pkgs.fetchFromGitHub {
owner = "XTLS";
repo = "Xray-core";
rev = "v${finalAttrs.version}";
hash = "sha256-M6biUT2RgP4xNGj9RUAVG7rrGNm65+sWL7pRQpbpWFI=";
};
vendorHash = "sha256-XfTEpPMKyIhaoG53omH5rewI86QFNc9pnzhvZvxgFp0=";
}
);
in
if lib.versionAtLeast pkgs.xray.version version then
pkgs.xray
else
(pkgs.xray.override (
args: lib.optionalAttrs (args ? buildGo126Module) { buildGo126Module = pkgs.buildGo127Module; }
)).overrideAttrs
(
finalAttrs: _: {
inherit version;
src = pkgs.fetchFromGitHub {
owner = "XTLS";
repo = "Xray-core";
rev = "v${finalAttrs.version}";
hash = "sha256-M6biUT2RgP4xNGj9RUAVG7rrGNm65+sWL7pRQpbpWFI=";
};
vendorHash = "sha256-XfTEpPMKyIhaoG53omH5rewI86QFNc9pnzhvZvxgFp0=";
}
)
base.overrideAttrs (old: {
patches = (old.patches or [ ]) ++ [ ./patches/xray-user-level-mark.patch ];
passthru = (old.passthru or { }) // {
userLevelMark = true;
};
})