@@ -0,0 +1,50 @@
1+{ stdenv, fetchFromGitLab, rustPlatform, cmake, pkgconfig, openssl
2+, darwin
3+}:
4+
5+with rustPlatform;
6+
7+buildRustPackage rec {
8+ name = "ffsend-${version}";
9+ version = "0.2.36";
10+
11+ src = fetchFromGitLab {
12+ owner = "timvisee";
13+ repo = "ffsend";
14+ rev = "v${version}";
15+ sha256 = "0k2sl1f5isxj8qajmhf36xh6k9j9qq7nkqm27wfm3gvc6b4flk0r";
16+ };
17+
18+ cargoSha256 = "1l4060kawba56gxsngba2yjshhaygrs17k1msjbj38vrg07zrnbp";
19+
20+ # Note: On Linux, the clipboard feature requires `xclip` to be in the `PATH`. Ideally we'd
21+ # depend on `xclip` and patch the source to run `xclip` from the Nix store instead of from `PATH`.
22+ # However, as I use macOS and not Linux, I'm not inclined to maintain a patch like that, nor do I
23+ # have a means to test it. To that end, we'll just leave the clipboard feature enabled and
24+ # trust that users that want to copy links to their clipboard will install `xclip` into their
25+ # profile.
26+
27+ nativeBuildInputs = [ cmake pkgconfig ];
28+ buildInputs = [ openssl ]
29+ ++ stdenv.lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ CoreFoundation CoreServices Security AppKit ])
30+ ;
31+
32+ postInstall = ''
33+ mkdir -p $out/share/zsh/site-functions
34+ cp contrib/completions/zsh/_ffsend $out/share/zsh/site-functions/_ffsend
35+ '';
36+
37+ meta = with stdenv.lib; {
38+ description = "Easily and securely share files from the command line. A fully featured Firefox Send client";
39+ longDescription = ''
40+ Easily and securely share files and directories from the command line through a safe, private
41+ and encrypted link using a single simple command. Files are shared using the Send service and
42+ may be up to 2GB. Others are able to download these files with this tool, or through their
43+ web browser.
44+ '';
45+ homepage = https://gitlab.com/timvisee/ffsend;
46+ license = licenses.gpl3;
47+ maintainers = [ maintainers.lilyball ];
48+ platforms = platforms.darwin ++ platforms.linux;
49+ };
50+}