nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, rustPlatform, fetchFromGitHub, installShellFiles, testers, fd }:
2
3rustPlatform.buildRustPackage rec {
4 pname = "fd";
5 version = "8.7.0";
6
7 src = fetchFromGitHub {
8 owner = "sharkdp";
9 repo = "fd";
10 rev = "v${version}";
11 hash = "sha256-y7IrwMLQnvz1PeKt8BE9hbEBwQBiUXM4geYbiTjMymw=";
12 };
13
14 cargoHash = "sha256-AstE8KGICgPhqRKlJecrE9iPUUWaOvca6ocWf85IzNo=";
15
16 nativeBuildInputs = [ installShellFiles ];
17
18 # skip flaky test
19 checkFlags = [
20 "--skip=test_owner_current_group"
21 ];
22
23 postInstall = ''
24 installManPage doc/fd.1
25
26 installShellCompletion --cmd fd \
27 --bash <($out/bin/fd --gen-completions bash) \
28 --fish <($out/bin/fd --gen-completions fish)
29 installShellCompletion --zsh contrib/completion/_fd
30 '';
31
32 passthru.tests.version = testers.testVersion {
33 package = fd;
34 };
35
36 meta = with lib; {
37 description = "A simple, fast and user-friendly alternative to find";
38 longDescription = ''
39 `fd` is a simple, fast and user-friendly alternative to `find`.
40
41 While it does not seek to mirror all of `find`'s powerful functionality,
42 it provides sensible (opinionated) defaults for 80% of the use cases.
43 '';
44 homepage = "https://github.com/sharkdp/fd";
45 changelog = "https://github.com/sharkdp/fd/blob/v${version}/CHANGELOG.md";
46 license = with licenses; [ asl20 /* or */ mit ];
47 maintainers = with maintainers; [ dywedir figsoda globin ma27 zowoq ];
48 };
49}