File tree Expand file tree Collapse file tree 1 file changed +61
-0
lines changed Expand file tree Collapse file tree 1 file changed +61
-0
lines changed Original file line number Diff line number Diff line change 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+ } )
You can’t perform that action at this time.
0 commit comments