lol
1{ lib
2, stdenv
3, fetchFromGitHub
4, rustPlatform
5, installShellFiles
6, Security
7}:
8
9rustPlatform.buildRustPackage rec {
10 pname = "sd";
11 version = "1.0.0";
12
13 src = fetchFromGitHub {
14 owner = "chmln";
15 repo = pname;
16 rev = "v${version}";
17 hash = "sha256-hC4VKEgrAVuqOX7b24XhtrxrnJW5kmlX4E6QbY9H8OA=";
18 };
19
20 cargoHash = "sha256-IhCuWCaSU7c7Tot4uvxE7oabY69wDLstuBN35OzkQcU=";
21
22 nativeBuildInputs = [ installShellFiles ];
23
24 buildInputs = lib.optionals stdenv.isDarwin [ Security ];
25
26 postInstall = ''
27 installManPage gen/sd.1
28
29 installShellCompletion gen/completions/sd.{bash,fish}
30 installShellCompletion --zsh gen/completions/_sd
31 '';
32
33 meta = with lib; {
34 description = "Intuitive find & replace CLI (sed alternative)";
35 homepage = "https://github.com/chmln/sd";
36 license = licenses.mit;
37 maintainers = with maintainers; [ amar1729 Br1ght0ne ];
38 };
39}