Kenichi Kamiya
2025-09-17 00:36:29 +09:00
parent 75b4e09602
commit d535ec48b8
+13 -3
View File
@@ -5,21 +5,23 @@
fetchFromGitHub,
installShellFiles,
versionCheckHook,
libredirect,
iana-etc,
nix-update-script,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "somo";
version = "1.1.0";
version = "1.2.0";
src = fetchFromGitHub {
owner = "theopfr";
repo = "somo";
tag = "v${finalAttrs.version}";
hash = "sha256-HUTaBSy3FemAQH1aKZYTJnUWiq0bU/H6c5Gz3yamPiA=";
hash = "sha256-QTW+hsoj8Wrv3BbFCB2aibR27Wu1MA/1gWzAXtPKWsM=";
};
cargoHash = "sha256-e3NrEfbWz6h9q4TJnn8jnRmMJbeaEc4Yo3hFlaRLzzQ=";
cargoHash = "sha256-xlAdEo11UV1Y49D1LjxH5Oykf/RUoe1w6ZcQpGhfqkk=";
nativeBuildInputs = [
installShellFiles
@@ -29,6 +31,14 @@ rustPlatform.buildRustPackage (finalAttrs: {
rustPlatform.bindgenHook
];
nativeCheckInputs = [
libredirect.hook
];
preCheck = ''
export NIX_REDIRECTS=/etc/services=${iana-etc}/etc/services
'';
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd somo \
--bash <("$out/bin/somo" generate-completions bash) \