nixpkgs/pkgs/tools/misc/ffsend/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

64 lines
2.0 KiB
Nix
Raw Normal View History

2022-06-24 07:20:00 +03:00
{ lib, stdenv, fetchFromGitLab, rustPlatform, pkg-config, openssl
2021-04-26 12:42:59 +03:00
, installShellFiles
2022-06-24 07:20:00 +03:00
, Security, AppKit
, x11Support ? stdenv.isLinux || stdenv.hostPlatform.isBSD
, xclip ? null, xsel ? null
, preferXsel ? false # if true and xsel is non-null, use it instead of xclip
2019-03-17 06:27:17 +03:00
}:
let
usesX11 = stdenv.isLinux || stdenv.isBSD;
in
assert (x11Support && usesX11) -> xclip != null || xsel != null;
2019-03-17 06:27:17 +03:00
with rustPlatform;
buildRustPackage rec {
2019-04-20 08:50:51 +03:00
pname = "ffsend";
2022-06-24 07:20:00 +03:00
version = "0.2.76";
2019-03-17 06:27:17 +03:00
src = fetchFromGitLab {
owner = "timvisee";
repo = "ffsend";
rev = "v${version}";
2022-06-24 07:20:00 +03:00
sha256 = "sha256-L1j1lXPxy9nWMeED9uzQHV5y7XTE6+DB57rDnXa4kMo=";
2019-03-17 06:27:17 +03:00
};
2022-06-24 07:20:00 +03:00
cargoSha256 = "sha256-zNLU9QnBGna5qb+iu2imOUvCIw3ZWRFsQlpFo5ECtKo=";
2019-03-17 06:27:17 +03:00
2022-06-24 07:20:00 +03:00
nativeBuildInputs = [ installShellFiles ]
++ lib.optionals stdenv.isLinux [ pkg-config ];
buildInputs =
2022-06-24 07:20:00 +03:00
if stdenv.isDarwin then [ Security AppKit ]
else [ openssl ];
2019-03-17 06:27:17 +03:00
2021-01-15 12:19:50 +03:00
preBuild = lib.optionalString (x11Support && usesX11) (
if preferXsel && xsel != null then ''
export XSEL_PATH="${xsel}/bin/xsel"
'' else ''
export XCLIP_PATH="${xclip}/bin/xclip"
''
);
2019-03-17 06:27:17 +03:00
postInstall = ''
2019-09-09 00:58:15 +03:00
installShellCompletion contrib/completions/ffsend.{bash,fish} --zsh contrib/completions/_ffsend
2019-03-17 06:27:17 +03:00
'';
# There's also .elv and .ps1 completion files but I don't know where to install those
2019-03-17 06:27:17 +03:00
meta = with lib; {
2019-03-17 06:27:17 +03:00
description = "Easily and securely share files from the command line. A fully featured Firefox Send client";
longDescription = ''
Easily and securely share files and directories from the command line through a safe, private
and encrypted link using a single simple command. Files are shared using the Send service and
may be up to 2GB. Others are able to download these files with this tool, or through their
web browser.
'';
homepage = "https://gitlab.com/timvisee/ffsend";
2021-04-23 12:56:44 +03:00
license = licenses.gpl3Only;
2022-06-24 07:20:00 +03:00
maintainers = with maintainers; [ lilyball equirosa marsam ];
platforms = platforms.unix;
2019-03-17 06:27:17 +03:00
};
}