nixpkgs/pkgs/by-name/sx/sx-go/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

47 lines
1.0 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, fetchpatch
, libpcap
}:
buildGoModule rec {
pname = "sx-go";
version = "0.5.0";
src = fetchFromGitHub {
owner = "v-byte-cpu";
repo = "sx";
rev = "v${version}";
sha256 = "sha256-HTIzA1QOVn3V/hGUu7wLIYUNYmcJ/FXi2yr6BGRizZA=";
};
vendorHash = "sha256-TWRMNt6x8zuvhP1nz4R6IVCX+9HityvVpzxRhDiMyO4=";
patches = [
# Fix darwin builds: https://github.com/v-byte-cpu/sx/pull/120
(fetchpatch {
name = "non-linux-method-signature.patch";
url = "https://github.com/v-byte-cpu/sx/commit/56457bfaa49eb6fbb7a33d7092d9c636b9c85895.patch";
hash = "sha256-0lCu3tZ0fEiC7qWfk1APLVwwrK9eovbVa/yG7OuXEWQ=";
})
];
buildInputs = [
libpcap
];
postFixup = ''
# Rename binary to avoid conflict with sx
mv $out/bin/sx $out/bin/${pname}
'';
meta = with lib; {
description = "Command-line network scanner";
homepage = "https://github.com/v-byte-cpu/sx";
license = licenses.mit;
maintainers = with maintainers; [ fab ];
mainProgram = "sx-go";
};
}