summary refs log tree commit diff
path: root/pkgs/tools/networking/clash-meta
diff options
context:
space:
mode:
authoroluceps <i@oluceps.uk>2023-02-20 23:14:29 +0800
committeroluceps <i@oluceps.uk>2023-02-20 23:14:29 +0800
commita43dc01871b7e90d12113ec79a7b55d9f3b259ce (patch)
tree63a05f7ef53d6e8917f393ce4f3bcf09699f65da /pkgs/tools/networking/clash-meta
parent750dddd303dc1c27180013cd0d84a70f9211eb7f (diff)
downloadnixpkgs-a43dc01871b7e90d12113ec79a7b55d9f3b259ce.tar
nixpkgs-a43dc01871b7e90d12113ec79a7b55d9f3b259ce.tar.gz
nixpkgs-a43dc01871b7e90d12113ec79a7b55d9f3b259ce.tar.bz2
nixpkgs-a43dc01871b7e90d12113ec79a7b55d9f3b259ce.tar.lz
nixpkgs-a43dc01871b7e90d12113ec79a7b55d9f3b259ce.tar.xz
nixpkgs-a43dc01871b7e90d12113ec79a7b55d9f3b259ce.tar.zst
nixpkgs-a43dc01871b7e90d12113ec79a7b55d9f3b259ce.zip
clash-meta: init at 1.14.2
Diffstat (limited to 'pkgs/tools/networking/clash-meta')
-rw-r--r--pkgs/tools/networking/clash-meta/default.nix44
1 files changed, 44 insertions, 0 deletions
diff --git a/pkgs/tools/networking/clash-meta/default.nix b/pkgs/tools/networking/clash-meta/default.nix
new file mode 100644
index 00000000000..e4f2e8399ff
--- /dev/null
+++ b/pkgs/tools/networking/clash-meta/default.nix
@@ -0,0 +1,44 @@
+{ lib
+, fetchFromGitHub
+, buildGoModule
+}:
+buildGoModule rec {
+  pname = "clash-meta";
+  version = "1.14.2";
+
+  src = fetchFromGitHub {
+    owner = "MetaCubeX";
+    repo = "Clash.Meta";
+    rev = "v${version}";
+    sha256 = "sha256-sn+0TNXCK4af4zfkf09hLsFkuvkcyjhwh35kKo993FQ=";
+  };
+
+  vendorHash = "sha256-3j+5fF57eu7JJd3rnrWYwuWDivycUkUTTzptYaK3G/Q=";
+
+  # Do not build testing suit
+  excludedPackages = [ "./test" ];
+
+  ldflags = [
+    "-s"
+    "-w"
+    "-X github.com/Dreamacro/clash/constant.Version=${version}"
+  ];
+
+  tags = [
+    "with_gvisor"
+  ];
+
+  # network required
+  doCheck = false;
+
+  postInstall = ''
+    mv $out/bin/clash $out/bin/clash-meta
+  '';
+
+  meta = with lib; {
+    description = "Another Clash Kernel";
+    homepage = "https://github.com/MetaCubeX/Clash.Meta";
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ oluceps ];
+  };
+}