nixpkgs/pkgs/by-name/ch/cheat/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

51 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";
};
}