git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #98734 from ju1m/zerobin
commitc2b66f270221c50d4dfee888ce92ed0e512300a2 authorDoron Behar <doron.behar@gmail.com> dateMon 29 Mar 2021, 17:18 (6 years ago) parent1ca0f5ba9ce4c4
8 files changed+96−58
doc/languages-frameworks/python.section.md+18−14 nixos/modules/services/networking/zerobin.nix+1−1 pkgs/applications/networking/zerobin/default.nix+61 pkgs/development/python-modules/beaker/default.nix+11−8 pkgs/development/python-modules/pyscss/default.nix+3 pkgs/development/python-modules/zerobin/default.nix−33 pkgs/top-level/all-packages.nix+2 pkgs/top-level/python-packages.nix−2
doc/languages-frameworks/python.section.md+18−14
@@ -1487,11 +1487,12 @@ If you need to change a package's attribute(s) from `configuration.nix` you coul
14871487 nixpkgs.config.packageOverrides = super: {
14881488 python = super.python.override {
14891489 packageOverrides = python-self: python-super: {
1490− zerobin = python-super.zerobin.overrideAttrs (oldAttrs: {
1491− src = super.fetchgit {
1492− url = "https://github.com/sametmax/0bin";
1493− rev = "a344dbb18fe7a855d0742b9a1cede7ce423b34ec";
1494− sha256 = "16d769kmnrpbdr0ph0whyf4yff5df6zi4kmwx7sz1d3r6c8p6xji";
1490+ twisted = python-super.twisted.overrideAttrs (oldAttrs: {
1491+ src = super.fetchPipy {
1492+ pname = "twisted";
1493+ version = "19.10.0";
1494+ sha256 = "7394ba7f272ae722a74f3d969dcf599bc4ef093bc392038748a490f1724a515d";
1495+ extension = "tar.bz2";
14951496 };
14961497 });
14971498 };
@@ -1499,9 +1500,11 @@ If you need to change a package's attribute(s) from `configuration.nix` you coul
14991500 };
15001501```
15011502
1502−`pythonPackages.zerobin` is now globally overridden. All packages and also the
1503−`zerobin` NixOS service use the new definition. Note that `python-super` refers
1504−to the old package set and `python-self` to the new, overridden version.
1503+`pythonPackages.twisted` is now globally overridden.
1504+All packages and also all NixOS services that reference `twisted`
1505+(such as `services.buildbot-worker`) now use the new definition.
1506+Note that `python-super` refers to the old package set and `python-self`
1507+to the new, overridden version.
15051508
15061509To modify only a Python package set instead of a whole Python derivation, use
15071510this snippet:
@@ -1509,7 +1512,7 @@ this snippet:
15091512```nix
15101513 myPythonPackages = pythonPackages.override {
15111514 overrides = self: super: {
1512− zerobin = ...;
1515+ twisted = ...;
15131516 };
15141517 }
15151518```
@@ -1522,11 +1525,12 @@ Use the following overlay template:
15221525self: super: {
15231526 python = super.python.override {
15241527 packageOverrides = python-self: python-super: {
1525− zerobin = python-super.zerobin.overrideAttrs (oldAttrs: {
1526− src = super.fetchgit {
1527− url = "https://github.com/sametmax/0bin";
1528− rev = "a344dbb18fe7a855d0742b9a1cede7ce423b34ec";
1529− sha256 = "16d769kmnrpbdr0ph0whyf4yff5df6zi4kmwx7sz1d3r6c8p6xji";
1528+ twisted = python-super.twisted.overrideAttrs (oldAttrs: {
1529+ src = super.fetchPypi {
1530+ pname = "twisted";
1531+ version = "19.10.0";
1532+ sha256 = "7394ba7f272ae722a74f3d969dcf599bc4ef093bc392038748a490f1724a515d";
1533+ extension = "tar.bz2";
15301534 };
15311535 });
15321536 };
nixos/modules/services/networking/zerobin.nix+1−1
@@ -88,7 +88,7 @@ in
8888 enable = true;
8989 after = [ "network.target" ];
9090 wantedBy = [ "multi-user.target" ];
91− serviceConfig.ExecStart = "${pkgs.pythonPackages.zerobin}/bin/zerobin ${cfg.listenAddress} ${toString cfg.listenPort} false ${cfg.user} ${cfg.group} ${zerobin_config}";
91+ serviceConfig.ExecStart = "${pkgs.zerobin}/bin/zerobin ${cfg.listenAddress} ${toString cfg.listenPort} false ${cfg.user} ${cfg.group} ${zerobin_config}";
9292 serviceConfig.PrivateTmp="yes";
9393 serviceConfig.User = cfg.user;
9494 serviceConfig.Group = cfg.group;
pkgs/applications/networking/zerobin/default.nixnew file+61
@@ -0,0 +1,61 @@
1+{ lib
2+, python3Packages
3+, fetchFromGitHub
4+, nodePackages
5+}:
6+
7+python3Packages.buildPythonApplication rec {
8+ pname = "zerobin";
9+ version = "1.0.5";
10+ src = fetchFromGitHub {
11+ owner = "Tygs";
12+ repo = "0bin";
13+ rev = "v${version}";
14+ sha256 = "1dfy3h823ylz4w2vv3mrmnmiyvf6rvyvsp4j3llr074w9id0zy16";
15+ };
16+
17+ disabled = python3Packages.pythonOlder "3.7";
18+
19+ nativeBuildInputs = [
20+ python3Packages.doit
21+ python3Packages.pyscss
22+ nodePackages.uglify-js
23+ ];
24+ propagatedBuildInputs = with python3Packages; [
25+ appdirs
26+ beaker
27+ bleach
28+ bottle
29+ clize
30+ lockfile
31+ paste
32+ ];
33+ prePatch = ''
34+ # replace /bin/bash in compress.sh
35+ patchShebangs .
36+
37+ # relax version constraints of some dependencies
38+ substituteInPlace setup.cfg \
39+ --replace "bleach==3.1.5" "bleach>=3.1.5,<4" \
40+ --replace "bottle==0.12.18" "bottle>=0.12.18,<1" \
41+ --replace "Paste==3.4.3" "Paste>=3.4.3,<4"
42+ '';
43+ buildPhase = ''
44+ runHook preBuild
45+ doit build
46+ runHook postBuild
47+ '';
48+
49+ # zerobin has no check, but checking would fail with:
50+ # nix_run_setup runserver: Received extra arguments: test
51+ # See https://github.com/NixOS/nixpkgs/pull/98734#discussion_r495823510
52+ doCheck = false;
53+
54+ meta = with lib; {
55+ description = "A client side encrypted pastebin";
56+ homepage = "https://0bin.net/";
57+ license = licenses.wtfpl;
58+ platforms = platforms.all;
59+ maintainers = with maintainers; [ julm ];
60+ };
61+}
pkgs/development/python-modules/beaker/default.nix+11−8
@@ -1,6 +1,8 @@
1−{ lib
1+{ stdenv
2+, lib
23, buildPythonPackage
34, fetchFromGitHub
5+, glibcLocales
46, nose
57, pylibmc
68, memcached
@@ -19,14 +21,14 @@
1921
2022buildPythonPackage rec {
2123 pname = "Beaker";
22− version = "1.10.1";
24+ version = "1.11.0";
2325
2426 # The pypy release do not contains the tests
2527 src = fetchFromGitHub {
2628 owner = "bbangert";
2729 repo = "beaker";
2830 rev = version;
29− sha256 = "0xrvg503xmi28w0hllr4s7fkap0p09fgw2wax3p1s2r6b3xjvbz7";
31+ sha256 = "059sc7iar90lc2y9mppdis5ddfcxyirz03gmsfb0307f5dsa1dhj";
3032 };
3133
3234 propagatedBuildInputs = [
@@ -39,16 +41,16 @@ buildPythonPackage rec {
3941 ];
4042
4143 checkInputs = [
42− nose
44+ glibcLocales
45+ memcached
4346 mock
44− webtest
47+ nose
4548 pylibmc
46− memcached
47− redis
4849 pymongo
50+ redis
51+ webtest
4952 ];
5053
51−
5254 # Can not run memcached tests because it immediately tries to connect
5355 postPatch = lib.optionalString isPy3k ''
5456 substituteInPlace setup.py \
@@ -66,6 +68,7 @@ buildPythonPackage rec {
6668 nosetests \
6769 -e ".*test_ext_.*" \
6870 -e "test_upgrade" \
71+ ${lib.optionalString (!stdenv.isLinux) ''-e "test_cookie_expires_different_locale"''} \
6972 -vv tests
7073 '';
7174
pkgs/development/python-modules/pyscss/default.nix+3
@@ -26,6 +26,9 @@ buildPythonPackage rec {
2626 ++ (lib.optionals (pythonOlder "3.4") [ enum34 pathlib ])
2727 ++ (lib.optionals (pythonOlder "2.7") [ ordereddict ]);
2828
29+ # Test suite is broken.
30+ # See https://github.com/Kronuz/pyScss/issues/415
31+ doCheck = false;
2932 checkPhase = ''
3033 py.test
3134 '';
pkgs/development/python-modules/zerobin/default.nixdeleted−33
@@ -1,33 +0,0 @@
1−{ lib
2−, buildPythonPackage
3−, fetchFromGitHub
4−, cherrypy
5−, bottle
6−, lockfile
7−, clize
8−}:
9−
10−buildPythonPackage {
11− pname = "zerobin";
12− version = "20160108";
13−
14− src = fetchFromGitHub {
15− owner = "sametmax";
16− repo = "0bin";
17− rev = "7da1615";
18− sha256 = "1pzcwy454kn5216pvwjqzz311s6jbh7viw9s6kw4xps6f5h44bid";
19− };
20−
21− propagatedBuildInputs = [ cherrypy bottle lockfile clize ];
22−
23− # zerobin doesn't have any tests, but includes a copy of cherrypy which
24− # can wrongly fail the check phase.
25− doCheck = false;
26−
27− meta = with lib; {
28− description = "A client side encrypted pastebin";
29− homepage = "https://0bin.net/";
30− license = licenses.wtfpl;
31− };
32−
33−}
pkgs/top-level/all-packages.nix+2
@@ -26747,6 +26747,8 @@ in
2674726747
2674826748 zathura = callPackage ../applications/misc/zathura { };
2674926749
26750+ zerobin = callPackage ../applications/networking/zerobin { };
26751+
2675026752 zeroc-ice = callPackage ../development/libraries/zeroc-ice {
2675126753 inherit (darwin.apple_sdk.frameworks) Security;
2675226754 };
pkgs/top-level/python-packages.nix−2
@@ -9067,8 +9067,6 @@ in {
90679067 python3 = python;
90689068 })).py;
90699069
9070− zerobin = callPackage ../development/python-modules/zerobin { };
9071−
90729070 zeroc-ice = callPackage ../development/python-modules/zeroc-ice { };
90739071
90749072 zeroconf = callPackage ../development/python-modules/zeroconf { };