about summary refs log tree commit diff
path: root/pkgs/applications/networking/zerobin
diff options
context:
space:
mode:
authorJulien Moutinho <julm+nixpkgs@sourcephile.fr>2020-09-27 09:33:46 +0200
committerJulien Moutinho <julm+nixpkgs@sourcephile.fr>2021-03-13 13:06:06 +0100
commita9ce4c4a0ea0f6b92fdc44d530dbb889ce789595 (patch)
tree33d8c17ac75d4f2e1254da86fe471e1ebdddb09a /pkgs/applications/networking/zerobin
parent0090fbbda5a546b67d1917288f2e533f15198e36 (diff)
zerobin: 20160108 -> 1.0.5
Diffstat (limited to 'pkgs/applications/networking/zerobin')
-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 ];
+  };
+}