depot/third_party/nixpkgs/pkgs/applications/misc/cheat/default.nix
Default email ae2dc6aea6 Project import generated by Copybara.
GitOrigin-RevId: 4c2fcb090b1f3e5b47eaa7bd33913b574a11e0a0
2024-10-11 07:15:48 +02:00

50 lines
1.1 KiB
Nix

{ lib, fetchFromGitHub
, buildGoModule, installShellFiles }:
buildGoModule rec {
pname = "cheat";
version = "4.4.2";
src = fetchFromGitHub {
owner = "cheat";
repo = "cheat";
rev = version;
sha256 = "sha256-GUU6VWfTmNS6ny12HnMr3uQmS7HI86Oupcmqx0MVAvE=";
};
subPackages = [ "cmd/cheat" ];
nativeBuildInputs = [ installShellFiles ];
patches = [
(builtins.toFile "fix-zsh-completion.patch" ''
diff --git a/scripts/cheat.zsh b/scripts/cheat.zsh
index befe1b2..675c9f8 100755
--- a/scripts/cheat.zsh
+++ b/scripts/cheat.zsh
@@ -62,4 +62,4 @@ _cheat() {
esac
}
-compdef _cheat cheat
+_cheat "$@"
'')
];
postInstall = ''
installManPage doc/cheat.1
installShellCompletion scripts/cheat.{bash,fish,zsh}
'';
vendorHash = null;
doCheck = false;
meta = with lib; {
description = "Create and view interactive cheatsheets on the command-line";
maintainers = with maintainers; [ mic92 ];
license = with licenses; [ gpl3 mit ];
inherit (src.meta) homepage;
mainProgram = "cheat";
};
}