Files
nixpkgs/pkgs/by-name/on/onefetch/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

80 lines
1.6 KiB
Nix

{
lib,
rustPlatform,
fetchFromGitHub,
cmake,
installShellFiles,
pkg-config,
zstd,
stdenv,
darwin,
gitMinimal,
}:
let
inherit (darwin) libresolv;
in
rustPlatform.buildRustPackage rec {
pname = "onefetch";
version = "2.25.0";
src = fetchFromGitHub {
owner = "o2sh";
repo = "onefetch";
rev = version;
hash = "sha256-ZaaSuHWkhJx0q1CBAiRhwoLeeyyoAj6/vP3AJwybjAo=";
};
cargoHash = "sha256-56Net4nNRndePhdsQPbmqiPHpOUGMmnQt6BuplQpvSU=";
cargoPatches = [
# enable pkg-config feature of zstd
./zstd-pkg-config.patch
];
nativeBuildInputs = [
cmake
installShellFiles
pkg-config
];
buildInputs = [
zstd
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
libresolv
];
nativeCheckInputs = [
gitMinimal
];
preCheck = ''
git init
git config user.name nixbld
git config user.email nixbld@example.com
git add .
git commit -m test
'';
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd onefetch \
--bash <($out/bin/onefetch --generate bash) \
--fish <($out/bin/onefetch --generate fish) \
--zsh <($out/bin/onefetch --generate zsh)
'';
meta = {
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 = lib.licenses.mit;
maintainers = with lib.maintainers; [
Br1ght0ne
figsoda
kloenk
];
mainProgram = "onefetch";
};
}