1
1
{
2
2
lib ,
3
3
stdenv ,
4
+ buildGoModule ,
5
+
4
6
fetchFromGitHub ,
5
- libsForQt5 ,
6
7
cmake ,
7
8
ninja ,
8
- protobuf ,
9
- yaml-cpp ,
10
- zxing-cpp ,
11
- callPackage ,
12
9
makeDesktopItem ,
13
10
copyDesktopItems ,
14
11
15
- v2ray-geoip ,
16
- v2ray-domain-list-community ,
17
- sing-geoip ,
18
- sing-geosite ,
12
+ libcpr ,
13
+ protobuf ,
14
+ qt6Packages ,
15
+ yaml-cpp ,
16
+ zxing-cpp ,
19
17
} :
20
18
21
- let
22
- fetchSource =
23
- args :
24
- fetchFromGitHub (
25
- args
26
- // {
27
- owner = "MatsuriDayo" ;
28
- repo = args . name ;
29
- }
30
- ) ;
31
-
32
- extraSources = {
33
- # revs found in https://github.com/MatsuriDayo/nekoray/blob/<version>/libs/get_source_env.sh
34
- Xray-core = fetchSource {
35
- name = "Xray-core" ;
36
- rev = "01208225ee7e508044cca8eb6776a117bcecd997" ;
37
- hash = "sha256-R66i9MITdE9JlhD4wV0EitKPxyahQqDNpunUxVTmupA=" ;
38
- } ;
39
- sing-box-extra = fetchSource {
40
- name = "sing-box-extra" ;
41
- rev = "d31d6da26a51a929349e0d75fd89dccbe20d1268" ;
42
- hash = "sha256-YlzMAff8VOZGyCP7ksjcmoBDHT5llTYwwXIrs+qO5P4=" ;
43
- } ;
44
-
45
- # revs found in https://github.com/MatsuriDayo/sing-box-extra/blob/<sing-box-extra.rev>/libs/get_source_env.sh
46
- sing-box = fetchSource {
47
- name = "sing-box" ;
48
- rev = "64f4eed2c667d9ff1e52a84233dee0e2ca32c17e" ;
49
- hash = "sha256-jIg/+fvTn46h6tE6YXtov+ZaBD/ywApTZbzHlT5v4lM=" ;
50
- } ;
51
- sing-quic = fetchSource {
52
- name = "sing-quic" ;
53
- rev = "e396733db4de15266f0cfdb43c392aca0759324a" ;
54
- hash = "sha256-un5NtZPRx1QAjwNhXkR9OVGldtfM1jQoNRUzt9oilUE=" ;
55
- } ;
56
- libneko = fetchSource {
57
- name = "libneko" ;
58
- rev = "5277a5bfc889ee7a89462695b0e678c1bd4909b1" ;
59
- hash = "sha256-6dlWDzI9ox4PQzEtJNgwA0pXmPC7fGrGId88Zl+1gpw=" ;
60
- } ;
61
- } ;
62
-
63
- geodata = {
64
- "geoip.dat" = "${ v2ray-geoip } /share/v2ray/geoip.dat" ;
65
- "geosite.dat" = "${ v2ray-domain-list-community } /share/v2ray/geosite.dat" ;
66
- "geoip.db" = "${ sing-geoip } /share/sing-box/geoip.db" ;
67
- "geosite.db" = "${ sing-geosite } /share/sing-box/geosite.db" ;
68
- } ;
69
-
70
- installGeodata = lib . concatStringsSep "\n " (
71
- lib . mapAttrsToList ( filename : file : ''
72
- install -Dm644 ${ file } "$out/share/nekoray/${ filename } "
73
- '' ) geodata
74
- ) ;
75
- in
76
19
stdenv . mkDerivation ( finalAttrs : {
77
20
pname = "nekoray" ;
78
- version = "3.26 " ;
21
+ version = "4.2.12 " ;
79
22
80
- src = fetchSource {
81
- name = "nekoray " ;
82
- rev = finalAttrs . version ;
83
- hash = "sha256-fDm6fCI6XA4DHKCN3zm9B7Qbdh3LTHYGK8fPmeEnhjI=" ;
84
- fetchSubmodules = true ;
23
+ src = fetchFromGitHub {
24
+ owner = "Mahdi-zarei " ;
25
+ repo = "nekoray" ;
26
+ tag = finalAttrs . version ;
27
+ hash = "sha256-5BXrfNPBZ+smpniA1jOPWE0X/be/C9MzswfbwmWEnyQ=" ;
85
28
} ;
86
29
87
30
strictDeps = true ;
88
31
89
32
nativeBuildInputs = [
90
- libsForQt5 . wrapQtAppsHook
91
33
cmake
92
- ninja
93
34
copyDesktopItems
35
+ ninja
36
+ qt6Packages . wrapQtAppsHook
94
37
] ;
95
38
96
39
buildInputs = [
97
- libsForQt5 . qtbase
98
- libsForQt5 . qttools
99
- libsForQt5 . qtwayland
100
- libsForQt5 . qtx11extras
40
+ libcpr
101
41
protobuf
42
+ qt6Packages . qtbase
43
+ qt6Packages . qttools
102
44
yaml-cpp
103
45
zxing-cpp
104
46
] ;
@@ -115,13 +57,8 @@ stdenv.mkDerivation (finalAttrs: {
115
57
ln -s "$out/share/nekoray/nekoray" "$out/bin"
116
58
117
59
# nekoray looks for other files and cores in the same directory it's located at
118
- ln -s ${ finalAttrs . passthru . nekoray-core } /bin/nekoray_core "$out/share/nekoray/nekoray_core"
119
60
ln -s ${ finalAttrs . passthru . nekobox-core } /bin/nekobox_core "$out/share/nekoray/nekobox_core"
120
61
121
- ${ installGeodata }
122
-
123
- install -Dm644 "$src/res/public/nekoray.png" "$out/share/icons/hicolor/256x256/apps/nekoray.png"
124
-
125
62
runHook postInstall
126
63
'' ;
127
64
@@ -133,27 +70,38 @@ stdenv.mkDerivation (finalAttrs: {
133
70
icon = "nekoray" ;
134
71
comment = finalAttrs . meta . description ;
135
72
terminal = false ;
136
- categories = [
137
- "Network"
138
- "Application"
139
- ] ;
73
+ categories = [ "Network" ] ;
140
74
} )
141
75
] ;
142
76
143
- passthru = {
144
- nekobox-core = callPackage ./nekobox-core.nix {
145
- inherit ( finalAttrs ) src version ;
146
- inherit extraSources ;
147
- } ;
148
- nekoray-core = callPackage ./nekoray-core.nix {
149
- inherit ( finalAttrs ) src version ;
150
- inherit extraSources ;
151
- } ;
77
+ passthru . nekobox-core = buildGoModule {
78
+ pname = "nekobox-core" ;
79
+ inherit ( finalAttrs ) version src ;
80
+ sourceRoot = "${ finalAttrs . src . name } /core/server" ;
81
+
82
+ vendorHash = "sha256-PDED6Haa3m2CZLij2A8Am7vSwep2YFrR984UNypduWo=" ;
83
+
84
+ # ldflags and tags are taken from script/build_go.sh
85
+ ldflags = [
86
+ "-w"
87
+ "-s"
88
+ "-X github.com/sagernet/sing-box/constant.Version=${ finalAttrs . version } "
89
+ ] ;
90
+
91
+ tags = [
92
+ "with_clash_api"
93
+ "with_gvisor"
94
+ "with_quic"
95
+ "with_wireguard"
96
+ "with_utls"
97
+ "with_ech"
98
+ "with_dhcp"
99
+ ] ;
152
100
} ;
153
101
154
102
meta = {
155
103
description = "Qt based cross-platform GUI proxy configuration manager" ;
156
- homepage = "https://github.com/MatsuriDayo /nekoray" ;
104
+ homepage = "https://github.com/Mahdi-zarei /nekoray" ;
157
105
license = lib . licenses . gpl3Plus ;
158
106
mainProgram = "nekoray" ;
159
107
maintainers = with lib . maintainers ; [ tomasajt ] ;
0 commit comments