nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 rustPlatform,
5 fetchFromGitHub,
6 installShellFiles,
7}:
8
9rustPlatform.buildRustPackage rec {
10 pname = "kondo";
11 version = "0.8";
12
13 src = fetchFromGitHub {
14 owner = "tbillington";
15 repo = "kondo";
16 rev = "v${version}";
17 hash = "sha256-OqOmOujnyLTqwzNvLWudQi+xa5v37JTtyUXaItnpnfs=";
18 };
19
20 cargoHash = "sha256-jmN7mtQ3CXfyeYrYD+JBE6ppln8+VJRBzygmczo8M04=";
21
22 nativeBuildInputs = [ installShellFiles ];
23
24 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
25 installShellCompletion --cmd kondo \
26 --bash <($out/bin/kondo --completions bash) \
27 --fish <($out/bin/kondo --completions fish) \
28 --zsh <($out/bin/kondo --completions zsh)
29 '';
30
31 meta = with lib; {
32 description = "Save disk space by cleaning unneeded files from software projects";
33 homepage = "https://github.com/tbillington/kondo";
34 license = licenses.mit;
35 maintainers = with maintainers; [ Br1ght0ne ];
36 mainProgram = "kondo";
37 };
38}