2023-11-08 05:00:37 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, installShellFiles
|
|
|
|
, Security
|
2019-04-26 04:37:21 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "sd";
|
2023-11-08 05:00:37 +00:00
|
|
|
version = "1.0.0";
|
2019-04-26 04:37:21 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "chmln";
|
|
|
|
repo = pname;
|
2020-03-31 21:30:56 +00:00
|
|
|
rev = "v${version}";
|
2023-11-08 05:00:37 +00:00
|
|
|
hash = "sha256-hC4VKEgrAVuqOX7b24XhtrxrnJW5kmlX4E6QbY9H8OA=";
|
2019-04-26 04:37:21 +00:00
|
|
|
};
|
|
|
|
|
2023-11-08 05:00:37 +00:00
|
|
|
cargoHash = "sha256-IhCuWCaSU7c7Tot4uvxE7oabY69wDLstuBN35OzkQcU=";
|
2019-06-16 20:00:00 +00:00
|
|
|
|
2021-07-04 06:24:11 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2021-01-15 09:19:50 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ Security ];
|
2019-04-26 04:37:21 +00:00
|
|
|
|
2023-11-08 05:00:37 +00:00
|
|
|
postInstall = ''
|
|
|
|
installManPage gen/sd.1
|
2021-07-04 06:24:11 +00:00
|
|
|
|
2023-11-08 05:00:37 +00:00
|
|
|
installShellCompletion gen/completions/sd.{bash,fish}
|
|
|
|
installShellCompletion --zsh gen/completions/_sd
|
2021-07-04 06:24:11 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-04-26 04:37:21 +00:00
|
|
|
description = "Intuitive find & replace CLI (sed alternative)";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "sd";
|
2019-06-16 20:00:00 +00:00
|
|
|
homepage = "https://github.com/chmln/sd";
|
2019-04-26 04:37:21 +00:00
|
|
|
license = licenses.mit;
|
2020-11-17 11:02:06 +00:00
|
|
|
maintainers = with maintainers; [ amar1729 Br1ght0ne ];
|
2019-04-26 04:37:21 +00:00
|
|
|
};
|
|
|
|
}
|