2020-05-15 21:57:56 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonApplication,
|
|
|
|
substituteAll,
|
|
|
|
fetchFromGitHub,
|
|
|
|
isPy3k,
|
2021-06-04 09:07:49 +00:00
|
|
|
colorama,
|
2020-05-15 21:57:56 +00:00
|
|
|
flask,
|
|
|
|
flask-httpauth,
|
2021-03-09 03:18:52 +00:00
|
|
|
flask-socketio,
|
2020-05-15 21:57:56 +00:00
|
|
|
stem,
|
2021-03-09 03:18:52 +00:00
|
|
|
psutil,
|
2020-05-15 21:57:56 +00:00
|
|
|
pyqt5,
|
|
|
|
pycrypto,
|
2021-03-09 03:18:52 +00:00
|
|
|
pyside2,
|
|
|
|
pytestCheckHook,
|
|
|
|
qrcode,
|
2020-05-15 21:57:56 +00:00
|
|
|
qt5,
|
|
|
|
requests,
|
2021-03-09 03:18:52 +00:00
|
|
|
unidecode,
|
2020-05-15 21:57:56 +00:00
|
|
|
tor,
|
|
|
|
obfs4,
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2021-06-04 09:07:49 +00:00
|
|
|
version = "2.3.2";
|
2020-05-15 21:57:56 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "micahflee";
|
|
|
|
repo = "onionshare";
|
|
|
|
rev = "v${version}";
|
2021-06-04 09:07:49 +00:00
|
|
|
sha256 = "sha256-mzLDvvpO82iGDnzY42wx1KCNmAxUgVhpaDVprtb+YOI=";
|
2020-05-15 21:57:56 +00:00
|
|
|
};
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Securely and anonymously send and receive files";
|
|
|
|
longDescription = ''
|
|
|
|
OnionShare is an open source tool for securely and anonymously sending
|
|
|
|
and receiving files using Tor onion services. It works by starting a web
|
|
|
|
server directly on your computer and making it accessible as an
|
|
|
|
unguessable Tor web address that others can load in Tor Browser to
|
|
|
|
download files from you, or upload files to you. It doesn't require
|
|
|
|
setting up a separate server, using a third party file-sharing service,
|
|
|
|
or even logging into an account.
|
|
|
|
|
|
|
|
Unlike services like email, Google Drive, DropBox, WeTransfer, or nearly
|
|
|
|
any other way people typically send files to each other, when you use
|
|
|
|
OnionShare you don't give any companies access to the files that you're
|
|
|
|
sharing. So long as you share the unguessable web address in a secure way
|
|
|
|
(like pasting it in an encrypted messaging app), no one but you and the
|
|
|
|
person you're sharing with can access the files.
|
|
|
|
'';
|
|
|
|
|
|
|
|
homepage = "https://onionshare.org/";
|
|
|
|
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = with maintainers; [ lourkeur ];
|
|
|
|
};
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
in rec {
|
|
|
|
onionshare = buildPythonApplication {
|
|
|
|
pname = "onionshare-cli";
|
|
|
|
inherit version meta;
|
|
|
|
src = "${src}/cli";
|
|
|
|
patches = [
|
|
|
|
# hardcode store paths of dependencies
|
|
|
|
(substituteAll {
|
|
|
|
src = ./fix-paths.patch;
|
|
|
|
inherit tor obfs4;
|
|
|
|
inherit (tor) geoip;
|
|
|
|
})
|
|
|
|
];
|
2020-05-15 21:57:56 +00:00
|
|
|
disable = !isPy3k;
|
|
|
|
propagatedBuildInputs = [
|
2021-06-04 09:07:49 +00:00
|
|
|
colorama
|
2020-05-15 21:57:56 +00:00
|
|
|
flask
|
|
|
|
flask-httpauth
|
2021-03-09 03:18:52 +00:00
|
|
|
flask-socketio
|
2020-05-15 21:57:56 +00:00
|
|
|
stem
|
2021-03-09 03:18:52 +00:00
|
|
|
psutil
|
2020-05-15 21:57:56 +00:00
|
|
|
pycrypto
|
|
|
|
requests
|
2021-03-09 03:18:52 +00:00
|
|
|
unidecode
|
2020-05-15 21:57:56 +00:00
|
|
|
];
|
2021-03-09 03:18:52 +00:00
|
|
|
|
2020-05-15 21:57:56 +00:00
|
|
|
buildInputs = [
|
|
|
|
tor
|
|
|
|
obfs4
|
|
|
|
];
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
# Tests use the home directory
|
|
|
|
export HOME="$(mktemp -d)"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
onionshare-gui = buildPythonApplication {
|
|
|
|
pname = "onionshare";
|
|
|
|
inherit version meta;
|
|
|
|
src = "${src}/desktop/src";
|
2020-05-15 21:57:56 +00:00
|
|
|
patches = [
|
2021-03-09 03:18:52 +00:00
|
|
|
# hardcode store paths of dependencies
|
2020-05-15 21:57:56 +00:00
|
|
|
(substituteAll {
|
2021-03-09 03:18:52 +00:00
|
|
|
src = ./fix-paths-gui.patch;
|
2020-05-15 21:57:56 +00:00
|
|
|
inherit tor obfs4;
|
|
|
|
inherit (tor) geoip;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
disable = !isPy3k;
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
onionshare
|
|
|
|
pyqt5
|
|
|
|
pyside2
|
|
|
|
psutil
|
|
|
|
qrcode
|
|
|
|
];
|
2020-05-15 21:57:56 +00:00
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
nativeBuildInputs = [ qt5.wrapQtAppsHook ];
|
2020-05-15 21:57:56 +00:00
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
preFixup = ''
|
|
|
|
wrapQtApp $out/bin/onionshare
|
2020-05-15 21:57:56 +00:00
|
|
|
'';
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
doCheck = false;
|
2020-05-15 21:57:56 +00:00
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
pythonImportsCheck = [ "onionshare" ];
|
2020-05-15 21:57:56 +00:00
|
|
|
};
|
|
|
|
}
|