nixpkgs/pkgs/tools/misc/onefetch/default.nix

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

65 lines
1.4 KiB
Nix
Raw Normal View History

{ lib
2021-07-04 00:40:07 +00:00
, rustPlatform
, fetchFromGitHub
2022-10-30 21:01:11 +00:00
, cmake
2022-11-17 16:02:30 +00:00
, installShellFiles
2022-01-24 03:09:15 +00:00
, pkg-config
, zstd
, stdenv
2021-07-04 00:40:07 +00:00
, CoreFoundation
, libresolv
, Security
, git
2021-07-04 00:40:07 +00:00
}:
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=";
2022-01-24 03:09:15 +00:00
cargoPatches = [
# enable pkg-config feature of zstd
./zstd-pkg-config.patch
];
2022-11-17 13:11:00 +00:00
nativeBuildInputs = [ cmake installShellFiles pkg-config ];
2022-01-24 03:09:15 +00:00
buildInputs = [ zstd ]
++ lib.optionals stdenv.isDarwin [ CoreFoundation libresolv Security ];
nativeCheckInputs = [
git
2022-10-30 21:01:11 +00:00
];
preCheck = ''
git init
2022-11-17 16:02:30 +00:00
git config user.name nixbld
git config user.email nixbld@example.com
git add .
git commit -m test
'';
2022-10-30 21:01:11 +00:00
2022-11-17 13:11:00 +00:00
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 ];
};
}