about summary refs log tree commit diff
path: root/pkgs/tools/networking/phantomsocks
diff options
context:
space:
mode:
authorfbewivpjsbsby <132867585+fbewivpjsbsby@users.noreply.github.com>2023-05-08 13:35:03 +0800
committerfbewivpjsbsby <132867585+fbewivpjsbsby@users.noreply.github.com>2023-05-15 11:01:37 +0800
commit211f15a271fe2e300aef7daa688d5060ac41ea46 (patch)
tree5d24e8aca836afca422c01da566469b9e6ffd8f0 /pkgs/tools/networking/phantomsocks
parent884ffbd847e015e0d6cb2767ba72f7e7320bf8ef (diff)
phantomsocks: fix build tag
Co-Authored-By: Sandro <sandro.jaeckel@gmail.com>
Diffstat (limited to 'pkgs/tools/networking/phantomsocks')
-rw-r--r--pkgs/tools/networking/phantomsocks/default.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/pkgs/tools/networking/phantomsocks/default.nix b/pkgs/tools/networking/phantomsocks/default.nix
index fc8fef3a14b88..6f3c3ad9a3362 100644
--- a/pkgs/tools/networking/phantomsocks/default.nix
+++ b/pkgs/tools/networking/phantomsocks/default.nix
@@ -1,6 +1,11 @@
 { lib
 , buildGoModule
 , fetchFromGitHub
+, stdenv
+, libpcap
+# Cann't be build with both pcap and rawsocket tags
+, withPcap ? (!stdenv.isLinux && !withRawsocket)
+, withRawsocket ? (stdenv.isLinux && !withPcap)
 }:
 
 buildGoModule rec {
@@ -16,6 +21,13 @@ buildGoModule rec {
 
   vendorHash = "sha256-c0NQfZuMMWz1ASwFBcpMNjxZwXLo++gMYBiNgvT8ZLQ=";
 
+  ldflags = [
+    "-s" "-w"
+  ];
+  buildInputs = lib.optional withPcap libpcap;
+  tags = lib.optional withPcap "pcap"
+    ++ lib.optional withRawsocket "rawsocket";
+
   meta = with lib;{
     homepage = "https://github.com/macronut/phantomsocks";
     description = "A cross-platform proxy client/server for Linux/Windows/macOS";