1 { lib, stdenv, fetchFromGitLab, fetchpatch, rustPlatform, pkg-config, openssl
5 , x11Support ? stdenv.hostPlatform.isLinux || stdenv.hostPlatform.isBSD
6 , xclip ? null, xsel ? null
7 , preferXsel ? false # if true and xsel is non-null, use it instead of xclip
11 usesX11 = stdenv.hostPlatform.isLinux || stdenv.hostPlatform.isBSD;
14 assert (x11Support && usesX11) -> xclip != null || xsel != null;
16 rustPlatform.buildRustPackage rec {
20 src = fetchFromGitLab {
24 hash = "sha256-L1j1lXPxy9nWMeED9uzQHV5y7XTE6+DB57rDnXa4kMo=";
27 cargoHash = "sha256-r1yIPV2sW/EpHJpdaJyi6pzE+rtNkBIxSUJF+XA8kbA=";
31 # Update dependencies (needed for the below patch to merge cleanly)
33 name = "Update-dependencies-1";
34 url = "https://github.com/timvisee/ffsend/commit/afb004680b9ed672c7e87ff23f16bb2c51fea06e.patch";
35 hash = "sha256-eDcbyi05aOq+muVWdLmlLzLXUKcrv/9Y0R+0aHgL4+s=";
38 # Disable unused features in prettytable-rs crate (needed for the below patch to merge cleanly)
40 name = "Disable-unused-features";
41 url = "https://github.com/timvisee/ffsend/commit/9b8dee12ea839f911ed207ff9602d929cab5d34b.patch";
42 hash = "sha256-6LK1Fqov+zEbPZ4+B6JCLXtXmgSad9vr9YO2oYodBSM=";
45 # Update dependencies (needed for the below patch to merge cleanly)
47 name = "Update-dependencies-2";
48 url = "https://github.com/timvisee/ffsend/commit/fd5b38f9ab9cbc5f962d1024f4809eb36ba8986c.patch";
49 hash = "sha256-BDZKrVtQHpOewmB2Lb6kUfy02swcNK+CYZ3lj3kwFV4=";
54 name = "Fix-segfault";
55 url = "https://github.com/timvisee/ffsend/commit/3c1c2dc28ca1d88c45f87496a7a96052f5c37858.patch";
56 hash = "sha256-2hWlFXDopNy26Df74nJoB1J8qzPEOpf61wEOEtxOVx8=";
60 nativeBuildInputs = [ installShellFiles ]
61 ++ lib.optionals stdenv.hostPlatform.isLinux [ pkg-config ];
63 if stdenv.hostPlatform.isDarwin then [ Security AppKit ]
66 preBuild = lib.optionalString (x11Support && usesX11) (
67 if preferXsel && xsel != null then ''
68 export XSEL_PATH="${xsel}/bin/xsel"
70 export XCLIP_PATH="${xclip}/bin/xclip"
75 installShellCompletion contrib/completions/ffsend.{bash,fish} --zsh contrib/completions/_ffsend
77 # There's also .elv and .ps1 completion files but I don't know where to install those
80 description = "Easily and securely share files from the command line. A fully featured Firefox Send client";
82 Easily and securely share files and directories from the command line through a safe, private
83 and encrypted link using a single simple command. Files are shared using the Send service and
84 may be up to 2GB. Others are able to download these files with this tool, or through their
87 homepage = "https://gitlab.com/timvisee/ffsend";
88 license = licenses.gpl3Only;
89 maintainers = with maintainers; [ equirosa ];
90 platforms = platforms.unix;
91 mainProgram = "ffsend";