mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-21 05:04:00 +00:00
71d1118bd4
Diff: https://github.com/o2sh/onefetch/compare/2.17.0...2.17.1 Changelog: https://github.com/o2sh/onefetch/blob/v2.17.1/CHANGELOG.md
65 lines
1.4 KiB
Nix
65 lines
1.4 KiB
Nix
{ lib
|
|
, rustPlatform
|
|
, fetchFromGitHub
|
|
, cmake
|
|
, installShellFiles
|
|
, pkg-config
|
|
, zstd
|
|
, stdenv
|
|
, CoreFoundation
|
|
, libresolv
|
|
, Security
|
|
, git
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "onefetch";
|
|
version = "2.17.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "o2sh";
|
|
repo = pname;
|
|
rev = version;
|
|
hash = "sha256-mIHaeEnMKOyEeEEkE5OZgQZWwFnm69GZui64iBZkfyo=";
|
|
};
|
|
|
|
cargoHash = "sha256-XFX3J/vgjboEu+xZWTkfo5jmZJkap1u3j9G9ewrzVqc=";
|
|
|
|
cargoPatches = [
|
|
# enable pkg-config feature of zstd
|
|
./zstd-pkg-config.patch
|
|
];
|
|
|
|
nativeBuildInputs = [ cmake installShellFiles pkg-config ];
|
|
|
|
buildInputs = [ zstd ]
|
|
++ lib.optionals stdenv.isDarwin [ CoreFoundation libresolv Security ];
|
|
|
|
nativeCheckInputs = [
|
|
git
|
|
];
|
|
|
|
preCheck = ''
|
|
git init
|
|
git config user.name nixbld
|
|
git config user.email nixbld@example.com
|
|
git add .
|
|
git commit -m test
|
|
'';
|
|
|
|
postInstall = ''
|
|
installShellCompletion --cmd onefetch \
|
|
--bash <($out/bin/onefetch --generate bash) \
|
|
--fish <($out/bin/onefetch --generate fish) \
|
|
--zsh <($out/bin/onefetch --generate zsh)
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Git repository summary on your terminal";
|
|
homepage = "https://github.com/o2sh/onefetch";
|
|
changelog = "https://github.com/o2sh/onefetch/blob/v${version}/CHANGELOG.md";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ Br1ght0ne figsoda kloenk SuperSandro2000 ];
|
|
};
|
|
}
|