Skip to content

Commit 7e026d0

Browse files
authored
somo: init at 1.1.0 (#423741)
2 parents 939c727 + 93b8f2e commit 7e026d0

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

pkgs/by-name/so/somo/package.nix

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
lib,
3+
stdenv,
4+
rustPlatform,
5+
fetchFromGitHub,
6+
installShellFiles,
7+
versionCheckHook,
8+
nix-update-script,
9+
}:
10+
11+
rustPlatform.buildRustPackage (finalAttrs: {
12+
pname = "somo";
13+
version = "1.1.0";
14+
15+
src = fetchFromGitHub {
16+
owner = "theopfr";
17+
repo = "somo";
18+
tag = "v${finalAttrs.version}";
19+
hash = "sha256-HUTaBSy3FemAQH1aKZYTJnUWiq0bU/H6c5Gz3yamPiA=";
20+
};
21+
22+
cargoHash = "sha256-e3NrEfbWz6h9q4TJnn8jnRmMJbeaEc4Yo3hFlaRLzzQ=";
23+
24+
nativeBuildInputs =
25+
[
26+
installShellFiles
27+
]
28+
++ lib.optionals stdenv.hostPlatform.isDarwin [
29+
# Avoids "couldn't find any valid shared libraries matching: ['libclang.dylib']" error on darwin in sandbox mode.
30+
rustPlatform.bindgenHook
31+
];
32+
33+
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
34+
installShellCompletion --cmd somo \
35+
--bash <("$out/bin/somo" generate-completions bash) \
36+
--zsh <("$out/bin/somo" generate-completions zsh) \
37+
--fish <("$out/bin/somo" generate-completions fish)
38+
'';
39+
40+
nativeInstallCheckInputs = [
41+
versionCheckHook
42+
];
43+
doInstallCheck = true;
44+
versionCheckProgramArg = "--version";
45+
46+
passthru = {
47+
updateScript = nix-update-script { };
48+
};
49+
50+
meta = {
51+
description = "Socket and port monitoring tool";
52+
homepage = "https://github.com/theopfr/somo";
53+
changelog = "https://github.com/theopfr/somo/blob/v${finalAttrs.version}/CHANGELOG.md";
54+
license = lib.licenses.mit;
55+
platforms = with lib.platforms; linux ++ darwin;
56+
maintainers = with lib.maintainers; [
57+
kachick
58+
];
59+
mainProgram = "somo";
60+
};
61+
})

0 commit comments

Comments
 (0)