nixpkgs/pkgs/by-name/ch/cheat/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

51 lines
1.1 KiB
Nix
Raw Normal View History

{ lib, fetchFromGitHub
2020-04-08 09:01:09 +00:00
, buildGoModule, installShellFiles }:
2016-09-13 10:36:00 +00:00
2019-10-30 13:40:01 +00:00
buildGoModule rec {
2017-09-12 08:37:57 +00:00
pname = "cheat";
2023-12-25 15:42:00 +00:00
version = "4.4.2";
2016-09-13 10:36:00 +00:00
2017-11-27 09:34:23 +00:00
src = fetchFromGitHub {
2020-03-25 08:20:40 +00:00
owner = "cheat";
2017-11-27 09:34:23 +00:00
repo = "cheat";
rev = version;
2023-12-25 15:42:00 +00:00
sha256 = "sha256-GUU6VWfTmNS6ny12HnMr3uQmS7HI86Oupcmqx0MVAvE=";
2016-09-13 10:36:00 +00:00
};
2019-10-30 13:40:01 +00:00
subPackages = [ "cmd/cheat" ];
2017-11-27 09:34:23 +00:00
2020-04-08 09:01:09 +00:00
nativeBuildInputs = [ installShellFiles ];
2024-10-11 15:33:19 +00:00
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 "$@"
'')
];
2020-04-08 09:01:09 +00:00
postInstall = ''
2020-05-24 19:14:14 +00:00
installManPage doc/cheat.1
2020-04-08 09:01:09 +00:00
installShellCompletion scripts/cheat.{bash,fish,zsh}
'';
vendorHash = null;
2019-01-29 11:57:36 +00:00
doCheck = false;
meta = with lib; {
2019-10-30 16:03:22 +00:00
description = "Create and view interactive cheatsheets on the command-line";
2017-09-12 08:37:57 +00:00
maintainers = with maintainers; [ mic92 ];
2019-01-29 11:57:36 +00:00
license = with licenses; [ gpl3 mit ];
2020-03-25 08:20:40 +00:00
inherit (src.meta) homepage;
2024-02-11 02:19:15 +00:00
mainProgram = "cheat";
2016-09-13 10:36:00 +00:00
};
}