2021-07-14 22:03:04 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, rustPlatform, installShellFiles, Security
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "sd";
|
2020-08-20 17:08:02 +00:00
|
|
|
version = "0.7.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "chmln";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2020-08-20 17:08:02 +00:00
|
|
|
sha256 = "0c5bsqs6c55x4j640vhzlmbiylhp5agr7lx0jrwcjazfyvxihc01";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
cargoSha256 = "1iwgy9zzdxay6hb9pz47jchy03jrsy5csxijlq4i228qhqnvq1lr";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ Security ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
preFixup = ''
|
|
|
|
installManPage $releaseDir/build/sd-*/out/sd.1
|
|
|
|
|
|
|
|
installShellCompletion $releaseDir/build/sd-*/out/sd.{bash,fish}
|
|
|
|
installShellCompletion --zsh $releaseDir/build/sd-*/out/_sd
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Intuitive find & replace CLI (sed alternative)";
|
|
|
|
homepage = "https://github.com/chmln/sd";
|
|
|
|
license = licenses.mit;
|
2020-11-19 00:13:47 +00:00
|
|
|
maintainers = with maintainers; [ amar1729 Br1ght0ne ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|