nixpkgs/pkgs/tools/misc/intermodal/default.nix
Wolfgang Walther e3244e9ff0
treewide: replace xxxFlagsArray with non-Array variant in nix code
The xxxFlagsArray variants were never meant to be used in nix code, at
least they can't be used properly without __structuredAttrs turned on.

If no spaces are passed in the argument the xxxFlagsArray can be
replaced as-is with the non-Array variant. When whitespace needs to be
passed, the derivation is additionally changed to enable
__structuredAttrs.
2024-08-19 23:28:13 +02:00

37 lines
1.2 KiB
Nix

{ lib, stdenv, rustPlatform, fetchFromGitHub, installShellFiles }:
rustPlatform.buildRustPackage rec {
pname = "intermodal";
version = "0.1.13";
src = fetchFromGitHub {
owner = "casey";
repo = pname;
rev = "v${version}";
hash = "sha256-hKMO7ZicXSYESXWKmDC2ILD996KoYDXS5HJExyXMdX4=";
};
cargoHash = "sha256-7vtUMG6mxAHKnbouyTsaUf1myJssxYoqAIOjc6m86Fo=";
# include_hidden test tries to use `chflags` on darwin
checkFlags = lib.optionals stdenv.isDarwin [ "--skip=subcommand::torrent::create::tests::include_hidden" ];
nativeBuildInputs = [ installShellFiles ];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd imdl \
--bash <($out/bin/imdl completions bash) \
--fish <($out/bin/imdl completions fish) \
--zsh <($out/bin/imdl completions zsh)
'';
meta = with lib; {
description = "User-friendly and featureful command-line BitTorrent metainfo utility";
homepage = "https://github.com/casey/intermodal";
changelog = "https://github.com/casey/intermodal/releases/tag/v${version}";
license = licenses.cc0;
maintainers = with maintainers; [ Br1ght0ne xrelkd ];
mainProgram = "imdl";
};
}