nixpkgs/pkgs/by-name/ch/charasay/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

42 lines
1.0 KiB
Nix

{ lib
, rustPlatform
, fetchFromGitHub
, installShellFiles
, stdenv
}:
rustPlatform.buildRustPackage rec {
pname = "charasay";
version = "3.2.0";
src = fetchFromGitHub {
owner = "latipun7";
repo = pname;
rev = "v${version}";
hash = "sha256-7z5+7yrx5X5rdBMNj9oWBZ2IX0s88c1SLhgz2IDDEn8=";
};
cargoHash = "sha256-5htNU8l+amh+C8EL1K4UcXzf5Pbhhjd5RhxrucJoj/M=";
nativeBuildInputs = [ installShellFiles ];
postPatch = ''
rm .cargo/config.toml
'';
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd chara \
--bash <($out/bin/chara completions --shell bash) \
--fish <($out/bin/chara completions --shell fish) \
--zsh <($out/bin/chara completions --shell zsh)
'';
meta = with lib; {
description = "Future of cowsay - Colorful characters saying something";
homepage = "https://github.com/latipun7/charasay";
license = licenses.mit;
maintainers = with maintainers; [ hmajid2301 ];
mainProgram = "chara";
};
}