about summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorDoron Behar <doron.behar@gmail.com>2021-03-29 17:18:29 +0000
committerGitHub <noreply@github.com>2021-03-29 17:18:29 +0000
commitc2b66f270221c50d4dfee888ce92ed0e512300a2 (patch)
treed10d0741c822b1a01e88ba853f3ad5bb7a23c844 /pkgs/applications
parent1ca0f5bafef272b50b5b8764fa0aa77201e2dc11 (diff)
parenta9ce4c4a0ea0f6b92fdc44d530dbb889ce789595 (diff)
Merge pull request #98734 from ju1m/zerobin
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/networking/zerobin/default.nix61
1 files changed, 61 insertions, 0 deletions
diff --git a/pkgs/applications/networking/zerobin/default.nix b/pkgs/applications/networking/zerobin/default.nix
new file mode 100644
index 0000000000000..b86fe7cc6410f
--- /dev/null
+++ b/pkgs/applications/networking/zerobin/default.nix
@@ -0,0 +1,61 @@
+{ lib
+, python3Packages
+, fetchFromGitHub
+, nodePackages
+}:
+
+python3Packages.buildPythonApplication rec {
+  pname = "zerobin";
+  version = "1.0.5";
+  src = fetchFromGitHub {
+    owner = "Tygs";
+    repo = "0bin";
+    rev = "v${version}";
+    sha256 = "1dfy3h823ylz4w2vv3mrmnmiyvf6rvyvsp4j3llr074w9id0zy16";
+  };
+
+  disabled = python3Packages.pythonOlder "3.7";
+
+  nativeBuildInputs = [
+    python3Packages.doit
+    python3Packages.pyscss
+    nodePackages.uglify-js
+  ];
+  propagatedBuildInputs = with python3Packages; [
+    appdirs
+    beaker
+    bleach
+    bottle
+    clize
+    lockfile
+    paste
+  ];
+  prePatch = ''
+    # replace /bin/bash in compress.sh
+    patchShebangs .
+
+    # relax version constraints of some dependencies
+    substituteInPlace setup.cfg \
+      --replace "bleach==3.1.5" "bleach>=3.1.5,<4" \
+      --replace "bottle==0.12.18" "bottle>=0.12.18,<1" \
+      --replace "Paste==3.4.3" "Paste>=3.4.3,<4"
+  '';
+  buildPhase = ''
+    runHook preBuild
+    doit build
+    runHook postBuild
+  '';
+
+  # zerobin has no check, but checking would fail with:
+  # nix_run_setup runserver: Received extra arguments: test
+  # See https://github.com/NixOS/nixpkgs/pull/98734#discussion_r495823510
+  doCheck = false;
+
+  meta = with lib; {
+    description = "A client side encrypted pastebin";
+    homepage = "https://0bin.net/";
+    license = licenses.wtfpl;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ julm ];
+  };
+}