nixpkgs/pkgs/by-name/ph/phantomsocks/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

44 lines
1.2 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, stdenv
, libpcap
# Cann't be build with both pcap and rawsocket tags
, withPcap ? (!stdenv.hostPlatform.isLinux && !withRawsocket)
, withRawsocket ? (stdenv.hostPlatform.isLinux && !withPcap)
}:
buildGoModule rec {
pname = "phantomsocks";
version = "unstable-2023-11-30";
src = fetchFromGitHub {
owner = "macronut";
repo = pname;
rev = "b1b13c5b88cf3bac54f39c37c0ffcb0b46e31049";
hash = "sha256-ptCzd2/8dNHjAkhwA2xpZH8Ki/9DnblHI2gAIpgM+8E=";
};
vendorHash = "sha256-0MJlz7HAhRThn8O42yhvU3p5HgTG8AkPM0ksSjWYAC4=";
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 = "Cross-platform proxy client/server for Linux/Windows/macOS";
longDescription = ''
A cross-platform proxy tool that could be used to modify TCP packets
to implement TCB desync to bypass detection and censoring.
'';
license = licenses.lgpl3Only;
maintainers = with maintainers; [ oluceps ];
mainProgram = "phantomsocks";
};
}