1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 installShellFiles,
6 versionCheckHook,
7 nix-update-script,
8}:
9
10stdenv.mkDerivation (finalAttrs: {
11 pname = "sockstat";
12 version = "1.1.0";
13
14 src = fetchFromGitHub {
15 owner = "mezantrop";
16 repo = "sockstat";
17 tag = finalAttrs.version;
18 hash = "sha256-7VfideKNWlWb9nnAL2TK7HiD0T5EJsQiagT2kPMwrdA=";
19 };
20
21 nativeBuildInputs = [ installShellFiles ];
22
23 installPhase = ''
24 runHook preInstall
25
26 installBin sockstat
27
28 runHook postInstall
29 '';
30
31 doInstallCheck = true;
32 nativeInstallCheckInputs = [ versionCheckHook ];
33 versionCheckProgramArg = "-v";
34
35 passthru = {
36 updateScript = nix-update-script { };
37 };
38
39 meta = {
40 description = "FreeBSD-like sockstat for macOS using libproc";
41 homepage = "https://github.com/mezantrop/sockstat";
42 changelog = "https://github.com/mezantrop/sockstat/releases/tag/${finalAttrs.version}";
43 license = lib.licenses.bsd2;
44 maintainers = with lib.maintainers; [ DimitarNestorov ];
45 platforms = lib.platforms.darwin;
46 mainProgram = "sockstat";
47 };
48})