depot/third_party/nixpkgs/pkgs/tools/misc/script-directory/default.nix
Default email 94427deb9d Project import generated by Copybara.
GitOrigin-RevId: f91ee3065de91a3531329a674a45ddcb3467a650
2023-05-24 16:37:59 +03:00

42 lines
845 B
Nix

{ lib
, stdenvNoCC
, fetchFromGitHub
, installShellFiles
, patsh
}:
stdenvNoCC.mkDerivation rec {
pname = "script-directory";
version = "1.1.0";
src = fetchFromGitHub {
owner = "ianthehenry";
repo = "sd";
rev = "v${version}";
hash = "sha256-X5RWCJQUqDnG2umcCk5KS6HQinTJVapBHp6szEmbc4U=";
};
nativeBuildInputs = [
installShellFiles
patsh
];
installPhase = ''
runHook preInstall
patsh -f sd
install -Dt "$out/bin" sd
installShellCompletion --zsh _sd
runHook postInstall
'';
meta = {
description = "A cozy nest for your scripts";
homepage = "https://github.com/ianthehenry/sd";
changelog = "https://github.com/ianthehenry/sd/tree/${src.rev}#changelog";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ janik ];
mainProgram = "sd";
};
}