mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-24 21:14:52 +00:00

We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
34 lines
1.1 KiB
Nix
34 lines
1.1 KiB
Nix
{ lib, rustPlatform, fetchCrate, installShellFiles, stdenv }:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "trashy";
|
|
version = "2.0.0";
|
|
|
|
src = fetchCrate {
|
|
inherit pname version;
|
|
hash = "sha256-1xHyhAV8hpgMngQdamRzEliyG60t+I3KfsDJi0+180o=";
|
|
};
|
|
|
|
cargoHash = "sha256-ZWqWtWzb+CLH1ravBb/oV+aPxplEyiC1wEFhvchcLqg=";
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
|
installShellCompletion --cmd trash \
|
|
--bash <($out/bin/trash completions bash) \
|
|
--fish <($out/bin/trash completions fish) \
|
|
--zsh <($out/bin/trash completions zsh) \
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Simple, fast, and featureful alternative to rm and trash-cli";
|
|
homepage = "https://github.com/oberblastmeister/trashy";
|
|
changelog = "https://github.com/oberblastmeister/trashy/blob/v${version}/CHANGELOG.md";
|
|
license = with licenses; [ asl20 /* or */ mit ];
|
|
maintainers = with maintainers; [ oberblastmeister ];
|
|
mainProgram = "trash";
|
|
# darwin is unsupported due to https://github.com/Byron/trash-rs/issues/8
|
|
platforms = platforms.linux;
|
|
};
|
|
}
|