From a9ce4c4a0ea0f6b92fdc44d530dbb889ce789595 Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Sun, 27 Sep 2020 09:33:46 +0200 Subject: [PATCH] zerobin: 20160108 -> 1.0.5 --- doc/languages-frameworks/python.section.md | 32 +++++----- nixos/modules/services/networking/zerobin.nix | 2 +- .../networking/zerobin/default.nix | 61 +++++++++++++++++++ .../python-modules/zerobin/default.nix | 33 ---------- pkgs/top-level/all-packages.nix | 2 + pkgs/top-level/python-packages.nix | 2 - 6 files changed, 82 insertions(+), 50 deletions(-) create mode 100644 pkgs/applications/networking/zerobin/default.nix delete mode 100644 pkgs/development/python-modules/zerobin/default.nix diff --git a/doc/languages-frameworks/python.section.md b/doc/languages-frameworks/python.section.md index 71193ed0cc0b..1d5d9ebb7d73 100644 --- a/doc/languages-frameworks/python.section.md +++ b/doc/languages-frameworks/python.section.md @@ -1486,11 +1486,12 @@ If you need to change a package's attribute(s) from `configuration.nix` you coul nixpkgs.config.packageOverrides = super: { python = super.python.override { packageOverrides = python-self: python-super: { - zerobin = python-super.zerobin.overrideAttrs (oldAttrs: { - src = super.fetchgit { - url = "https://github.com/sametmax/0bin"; - rev = "a344dbb18fe7a855d0742b9a1cede7ce423b34ec"; - sha256 = "16d769kmnrpbdr0ph0whyf4yff5df6zi4kmwx7sz1d3r6c8p6xji"; + twisted = python-super.twisted.overrideAttrs (oldAttrs: { + src = super.fetchPipy { + pname = "twisted"; + version = "19.10.0"; + sha256 = "7394ba7f272ae722a74f3d969dcf599bc4ef093bc392038748a490f1724a515d"; + extension = "tar.bz2"; }; }); }; @@ -1498,9 +1499,11 @@ If you need to change a package's attribute(s) from `configuration.nix` you coul }; ``` -`pythonPackages.zerobin` is now globally overridden. All packages and also the -`zerobin` NixOS service use the new definition. Note that `python-super` refers -to the old package set and `python-self` to the new, overridden version. +`pythonPackages.twisted` is now globally overridden. +All packages and also all NixOS services that reference `twisted` +(such as `services.buildbot-worker`) now use the new definition. +Note that `python-super` refers to the old package set and `python-self` +to the new, overridden version. To modify only a Python package set instead of a whole Python derivation, use this snippet: @@ -1508,7 +1511,7 @@ this snippet: ```nix myPythonPackages = pythonPackages.override { overrides = self: super: { - zerobin = ...; + twisted = ...; }; } ``` @@ -1521,11 +1524,12 @@ Use the following overlay template: self: super: { python = super.python.override { packageOverrides = python-self: python-super: { - zerobin = python-super.zerobin.overrideAttrs (oldAttrs: { - src = super.fetchgit { - url = "https://github.com/sametmax/0bin"; - rev = "a344dbb18fe7a855d0742b9a1cede7ce423b34ec"; - sha256 = "16d769kmnrpbdr0ph0whyf4yff5df6zi4kmwx7sz1d3r6c8p6xji"; + twisted = python-super.twisted.overrideAttrs (oldAttrs: { + src = super.fetchPypi { + pname = "twisted"; + version = "19.10.0"; + sha256 = "7394ba7f272ae722a74f3d969dcf599bc4ef093bc392038748a490f1724a515d"; + extension = "tar.bz2"; }; }); }; diff --git a/nixos/modules/services/networking/zerobin.nix b/nixos/modules/services/networking/zerobin.nix index 78de246a816f..16db25d62304 100644 --- a/nixos/modules/services/networking/zerobin.nix +++ b/nixos/modules/services/networking/zerobin.nix @@ -88,7 +88,7 @@ in enable = true; after = [ "network.target" ]; wantedBy = [ "multi-user.target" ]; - serviceConfig.ExecStart = "${pkgs.pythonPackages.zerobin}/bin/zerobin ${cfg.listenAddress} ${toString cfg.listenPort} false ${cfg.user} ${cfg.group} ${zerobin_config}"; + serviceConfig.ExecStart = "${pkgs.zerobin}/bin/zerobin ${cfg.listenAddress} ${toString cfg.listenPort} false ${cfg.user} ${cfg.group} ${zerobin_config}"; serviceConfig.PrivateTmp="yes"; serviceConfig.User = cfg.user; serviceConfig.Group = cfg.group; diff --git a/pkgs/applications/networking/zerobin/default.nix b/pkgs/applications/networking/zerobin/default.nix new file mode 100644 index 000000000000..b86fe7cc6410 --- /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 ]; + }; +} diff --git a/pkgs/development/python-modules/zerobin/default.nix b/pkgs/development/python-modules/zerobin/default.nix deleted file mode 100644 index 19d02a70496b..000000000000 --- a/pkgs/development/python-modules/zerobin/default.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ lib -, buildPythonPackage -, fetchFromGitHub -, cherrypy -, bottle -, lockfile -, clize -}: - -buildPythonPackage { - pname = "zerobin"; - version = "20160108"; - - src = fetchFromGitHub { - owner = "sametmax"; - repo = "0bin"; - rev = "7da1615"; - sha256 = "1pzcwy454kn5216pvwjqzz311s6jbh7viw9s6kw4xps6f5h44bid"; - }; - - propagatedBuildInputs = [ cherrypy bottle lockfile clize ]; - - # zerobin doesn't have any tests, but includes a copy of cherrypy which - # can wrongly fail the check phase. - doCheck = false; - - meta = with lib; { - description = "A client side encrypted pastebin"; - homepage = "https://0bin.net/"; - license = licenses.wtfpl; - }; - -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c4c0ba9a7b6b..df66d379e21c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -26288,6 +26288,8 @@ in zathura = callPackage ../applications/misc/zathura { }; + zerobin = callPackage ../applications/networking/zerobin { }; + zeroc-ice = callPackage ../development/libraries/zeroc-ice { inherit (darwin.apple_sdk.frameworks) Security; }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f138554c839e..8ebfdc4db3c0 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8571,8 +8571,6 @@ in { zeitgeist = (toPythonModule (pkgs.zeitgeist.override { python3 = python; })).py; - zerobin = callPackage ../development/python-modules/zerobin { }; - zeroc-ice = callPackage ../development/python-modules/zeroc-ice { }; zeroconf = callPackage ../development/python-modules/zeroconf { };