1{ lib
2, stdenv
3, fetchFromGitHub
4, rustPlatform
5, installShellFiles
6, darwin
7, pandoc
8, testers
9, lsd
10}:
11
12rustPlatform.buildRustPackage rec {
13 pname = "lsd";
14 version = "1.0.0";
15
16 src = fetchFromGitHub {
17 owner = "lsd-rs";
18 repo = "lsd";
19 rev = "v${version}";
20 hash = "sha256-syT+1LNdigUWkfJ/wkbY/kny2uW6qfpl7KmW1FjZKR8=";
21 };
22
23 cargoHash = "sha256-viLr76Bq9OkPMp+BoprQusMDgx59nbevVi4uxjZ+eZg=";
24
25 nativeBuildInputs = [ installShellFiles pandoc ];
26
27 buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ];
28
29 postInstall = ''
30 pandoc --standalone --to man doc/lsd.md -o lsd.1
31 installManPage lsd.1
32
33 installShellCompletion --cmd lsd \
34 --bash $releaseDir/build/lsd-*/out/lsd.bash \
35 --fish $releaseDir/build/lsd-*/out/lsd.fish \
36 --zsh $releaseDir/build/lsd-*/out/_lsd
37 '';
38
39 # Found argument '--test-threads' which wasn't expected, or isn't valid in this context
40 doCheck = false;
41
42 passthru.tests.version = testers.testVersion {
43 package = lsd;
44 };
45
46 meta = with lib; {
47 homepage = "https://github.com/lsd-rs/lsd";
48 description = "The next gen ls command";
49 license = licenses.asl20;
50 maintainers = with maintainers; [ marsam zowoq SuperSandro2000 ];
51 };
52}