nixpkgs/pkgs/tools/text/sd/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

41 lines
916 B
Nix
Raw Normal View History

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
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
2023-11-08 05:00:37 +00:00
installShellCompletion gen/completions/sd.{bash,fish}
installShellCompletion --zsh gen/completions/_sd
'';
meta = with lib; {
2019-04-26 04:37:21 +00:00
description = "Intuitive find & replace CLI (sed alternative)";
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;
maintainers = with maintainers; [ amar1729 Br1ght0ne ];
2019-04-26 04:37:21 +00:00
};
}