1{ lib
2, stdenvNoCC
3, fetchFromGitHub
4, installShellFiles
5, patsh
6}:
7
8stdenvNoCC.mkDerivation rec {
9 pname = "script-directory";
10 version = "1.1.0";
11
12 src = fetchFromGitHub {
13 owner = "ianthehenry";
14 repo = "sd";
15 rev = "v${version}";
16 hash = "sha256-X5RWCJQUqDnG2umcCk5KS6HQinTJVapBHp6szEmbc4U=";
17 };
18
19 nativeBuildInputs = [
20 installShellFiles
21 patsh
22 ];
23
24 installPhase = ''
25 runHook preInstall
26
27 patsh -f sd
28 install -Dt "$out/bin" sd
29 installShellCompletion --zsh _sd
30
31 runHook postInstall
32 '';
33
34 meta = {
35 description = "A cozy nest for your scripts";
36 homepage = "https://github.com/ianthehenry/sd";
37 changelog = "https://github.com/ianthehenry/sd/tree/${src.rev}#changelog";
38 license = lib.licenses.mit;
39 maintainers = with lib.maintainers; [ janik ];
40 mainProgram = "sd";
41 };
42}