2022-11-06 21:47:29 +00:00
|
|
|
{ lib
|
2021-07-04 00:40:07 +00:00
|
|
|
, rustPlatform
|
2022-11-06 21:47:29 +00:00
|
|
|
, 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
|
2022-11-06 21:47:29 +00:00
|
|
|
, stdenv
|
2021-07-04 00:40:07 +00:00
|
|
|
, CoreFoundation
|
|
|
|
, libresolv
|
|
|
|
, Security
|
2022-11-06 21:47:29 +00:00
|
|
|
, git
|
2021-07-04 00:40:07 +00:00
|
|
|
}:
|
2019-11-25 20:06:35 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "onefetch";
|
2023-04-28 20:23:58 +00:00
|
|
|
version = "2.17.1";
|
2019-11-25 20:06:35 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "o2sh";
|
|
|
|
repo = pname;
|
2022-11-27 21:03:19 +00:00
|
|
|
rev = version;
|
2023-04-28 20:23:58 +00:00
|
|
|
hash = "sha256-mIHaeEnMKOyEeEEkE5OZgQZWwFnm69GZui64iBZkfyo=";
|
2019-11-25 20:06:35 +00:00
|
|
|
};
|
|
|
|
|
2023-04-28 20:23:58 +00:00
|
|
|
cargoHash = "sha256-XFX3J/vgjboEu+xZWTkfo5jmZJkap1u3j9G9ewrzVqc=";
|
2022-01-24 03:09:15 +00:00
|
|
|
|
2022-11-06 21:47:29 +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 ]
|
2022-11-06 21:47:29 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ CoreFoundation libresolv Security ];
|
2019-11-25 20:06:35 +00:00
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [
|
2022-11-06 21:47:29 +00:00
|
|
|
git
|
2022-10-30 21:01:11 +00:00
|
|
|
];
|
|
|
|
|
2022-11-06 21:47:29 +00:00
|
|
|
preCheck = ''
|
|
|
|
git init
|
2022-11-17 16:02:30 +00:00
|
|
|
git config user.name nixbld
|
2022-11-06 21:47:29 +00:00
|
|
|
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)
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-11-25 20:06:35 +00:00
|
|
|
description = "Git repository summary on your terminal";
|
|
|
|
homepage = "https://github.com/o2sh/onefetch";
|
2022-11-06 21:47:29 +00:00
|
|
|
changelog = "https://github.com/o2sh/onefetch/blob/v${version}/CHANGELOG.md";
|
2019-11-25 20:06:35 +00:00
|
|
|
license = licenses.mit;
|
2022-11-06 21:47:29 +00:00
|
|
|
maintainers = with maintainers; [ Br1ght0ne figsoda kloenk SuperSandro2000 ];
|
2019-11-25 20:06:35 +00:00
|
|
|
};
|
|
|
|
}
|