2022-11-21 17:40:18 +00:00
|
|
|
{ lib
|
2021-07-04 02:40:35 +00:00
|
|
|
, rustPlatform
|
2022-11-21 17:40:18 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, installShellFiles
|
2022-01-25 03:21:06 +00:00
|
|
|
, pkg-config
|
|
|
|
, zstd
|
2022-11-21 17:40:18 +00:00
|
|
|
, stdenv
|
2021-07-04 02:40:35 +00:00
|
|
|
, CoreFoundation
|
|
|
|
, libresolv
|
|
|
|
, Security
|
2022-11-21 17:40:18 +00:00
|
|
|
, git
|
2021-07-04 02:40:35 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "onefetch";
|
2023-02-02 18:25:31 +00:00
|
|
|
version = "2.15.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "o2sh";
|
|
|
|
repo = pname;
|
2022-12-02 08:20:57 +00:00
|
|
|
rev = version;
|
2023-02-02 18:25:31 +00:00
|
|
|
sha256 = "sha256-3wXZBPYths3+Vhtq4W2BTR47V63o0bq++fWLIpWrm7Y=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
cargoSha256 = "sha256-xBw2OMJMale4MWRyy6v0E0ZE4A98QXLyRu0k7L+9q8k=";
|
2022-11-21 17:40:18 +00:00
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
cargoPatches = [
|
|
|
|
# enable pkg-config feature of zstd
|
|
|
|
./zstd-pkg-config.patch
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
nativeBuildInputs = [ cmake installShellFiles pkg-config ];
|
2022-01-25 03:21:06 +00:00
|
|
|
|
|
|
|
buildInputs = [ zstd ]
|
2022-11-21 17:40:18 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ CoreFoundation libresolv Security ];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-11-21 17:40:18 +00:00
|
|
|
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)
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Git repository summary on your terminal";
|
|
|
|
homepage = "https://github.com/o2sh/onefetch";
|
2022-11-21 17:40:18 +00:00
|
|
|
changelog = "https://github.com/o2sh/onefetch/blob/v${version}/CHANGELOG.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2022-11-21 17:40:18 +00:00
|
|
|
maintainers = with maintainers; [ Br1ght0ne figsoda kloenk SuperSandro2000 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|