garbage 0.4.3

CLI tool for interacting with the freedesktop trashcan
Documentation
{ toolchain, makeRustPlatform, GARBAGE_VERSION, nix-gitignore, installShellFiles
}:

let rustPlatform = makeRustPlatform { inherit (toolchain) cargo rustc; };

in rustPlatform.buildRustPackage {
  name = "garbage";

  src = nix-gitignore.gitignoreSource [ ./.gitignore ] ./.;
  cargoLock = { lockFile = ./Cargo.lock; };

  nativeBuildInputs = [ installShellFiles ];

  inherit GARBAGE_VERSION;

  postInstall = ''
    completions=$(mktemp -d)
    $out/bin/garbage generate-completions bash > $completions/garbage.bash
    $out/bin/garbage generate-completions fish > $completions/garbage.fish
    $out/bin/garbage generate-completions zsh > $completions/garbage.zsh
    installShellCompletion $completions/garbage.{bash,fish,zsh}
  '';

  meta = {
    description = "CLI tool to interact with the FreeDesktop trash API.";
    mainProgram = "garbage";
  };
}