Merge pull request #98734 from ju1m/zerobin

authored by

Doron Behar and committed by
GitHub
c2b66f27 1ca0f5ba

+96 -58
+18 -14
doc/languages-frameworks/python.section.md
··· 1487 nixpkgs.config.packageOverrides = super: { 1488 python = super.python.override { 1489 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"; 1495 }; 1496 }); 1497 }; ··· 1499 }; 1500 ``` 1501 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. 1505 1506 To modify only a Python package set instead of a whole Python derivation, use 1507 this snippet: ··· 1509 ```nix 1510 myPythonPackages = pythonPackages.override { 1511 overrides = self: super: { 1512 - zerobin = ...; 1513 }; 1514 } 1515 ``` ··· 1522 self: super: { 1523 python = super.python.override { 1524 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"; 1530 }; 1531 }); 1532 };
··· 1487 nixpkgs.config.packageOverrides = super: { 1488 python = super.python.override { 1489 packageOverrides = python-self: python-super: { 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"; 1496 }; 1497 }); 1498 }; ··· 1500 }; 1501 ``` 1502 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. 1508 1509 To modify only a Python package set instead of a whole Python derivation, use 1510 this snippet: ··· 1512 ```nix 1513 myPythonPackages = pythonPackages.override { 1514 overrides = self: super: { 1515 + twisted = ...; 1516 }; 1517 } 1518 ``` ··· 1525 self: super: { 1526 python = super.python.override { 1527 packageOverrides = python-self: python-super: { 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"; 1534 }; 1535 }); 1536 };
+1 -1
nixos/modules/services/networking/zerobin.nix
··· 88 enable = true; 89 after = [ "network.target" ]; 90 wantedBy = [ "multi-user.target" ]; 91 - serviceConfig.ExecStart = "${pkgs.pythonPackages.zerobin}/bin/zerobin ${cfg.listenAddress} ${toString cfg.listenPort} false ${cfg.user} ${cfg.group} ${zerobin_config}"; 92 serviceConfig.PrivateTmp="yes"; 93 serviceConfig.User = cfg.user; 94 serviceConfig.Group = cfg.group;
··· 88 enable = true; 89 after = [ "network.target" ]; 90 wantedBy = [ "multi-user.target" ]; 91 + serviceConfig.ExecStart = "${pkgs.zerobin}/bin/zerobin ${cfg.listenAddress} ${toString cfg.listenPort} false ${cfg.user} ${cfg.group} ${zerobin_config}"; 92 serviceConfig.PrivateTmp="yes"; 93 serviceConfig.User = cfg.user; 94 serviceConfig.Group = cfg.group;
+61
pkgs/applications/networking/zerobin/default.nix
···
··· 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 + }
+11 -8
pkgs/development/python-modules/beaker/default.nix
··· 1 - { lib 2 , buildPythonPackage 3 , fetchFromGitHub 4 , nose 5 , pylibmc 6 , memcached ··· 19 20 buildPythonPackage rec { 21 pname = "Beaker"; 22 - version = "1.10.1"; 23 24 # The pypy release do not contains the tests 25 src = fetchFromGitHub { 26 owner = "bbangert"; 27 repo = "beaker"; 28 rev = version; 29 - sha256 = "0xrvg503xmi28w0hllr4s7fkap0p09fgw2wax3p1s2r6b3xjvbz7"; 30 }; 31 32 propagatedBuildInputs = [ ··· 39 ]; 40 41 checkInputs = [ 42 - nose 43 mock 44 - webtest 45 pylibmc 46 - memcached 47 - redis 48 pymongo 49 ]; 50 - 51 52 # Can not run memcached tests because it immediately tries to connect 53 postPatch = lib.optionalString isPy3k '' ··· 66 nosetests \ 67 -e ".*test_ext_.*" \ 68 -e "test_upgrade" \ 69 -vv tests 70 ''; 71
··· 1 + { stdenv 2 + , lib 3 , buildPythonPackage 4 , fetchFromGitHub 5 + , glibcLocales 6 , nose 7 , pylibmc 8 , memcached ··· 21 22 buildPythonPackage rec { 23 pname = "Beaker"; 24 + version = "1.11.0"; 25 26 # The pypy release do not contains the tests 27 src = fetchFromGitHub { 28 owner = "bbangert"; 29 repo = "beaker"; 30 rev = version; 31 + sha256 = "059sc7iar90lc2y9mppdis5ddfcxyirz03gmsfb0307f5dsa1dhj"; 32 }; 33 34 propagatedBuildInputs = [ ··· 41 ]; 42 43 checkInputs = [ 44 + glibcLocales 45 + memcached 46 mock 47 + nose 48 pylibmc 49 pymongo 50 + redis 51 + webtest 52 ]; 53 54 # Can not run memcached tests because it immediately tries to connect 55 postPatch = lib.optionalString isPy3k '' ··· 68 nosetests \ 69 -e ".*test_ext_.*" \ 70 -e "test_upgrade" \ 71 + ${lib.optionalString (!stdenv.isLinux) ''-e "test_cookie_expires_different_locale"''} \ 72 -vv tests 73 ''; 74
+3
pkgs/development/python-modules/pyscss/default.nix
··· 26 ++ (lib.optionals (pythonOlder "3.4") [ enum34 pathlib ]) 27 ++ (lib.optionals (pythonOlder "2.7") [ ordereddict ]); 28 29 checkPhase = '' 30 py.test 31 '';
··· 26 ++ (lib.optionals (pythonOlder "3.4") [ enum34 pathlib ]) 27 ++ (lib.optionals (pythonOlder "2.7") [ ordereddict ]); 28 29 + # Test suite is broken. 30 + # See https://github.com/Kronuz/pyScss/issues/415 31 + doCheck = false; 32 checkPhase = '' 33 py.test 34 '';
-33
pkgs/development/python-modules/zerobin/default.nix
··· 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 - }
···
+2
pkgs/top-level/all-packages.nix
··· 26747 26748 zathura = callPackage ../applications/misc/zathura { }; 26749 26750 zeroc-ice = callPackage ../development/libraries/zeroc-ice { 26751 inherit (darwin.apple_sdk.frameworks) Security; 26752 };
··· 26747 26748 zathura = callPackage ../applications/misc/zathura { }; 26749 26750 + zerobin = callPackage ../applications/networking/zerobin { }; 26751 + 26752 zeroc-ice = callPackage ../development/libraries/zeroc-ice { 26753 inherit (darwin.apple_sdk.frameworks) Security; 26754 };
-2
pkgs/top-level/python-packages.nix
··· 9067 python3 = python; 9068 })).py; 9069 9070 - zerobin = callPackage ../development/python-modules/zerobin { }; 9071 - 9072 zeroc-ice = callPackage ../development/python-modules/zeroc-ice { }; 9073 9074 zeroconf = callPackage ../development/python-modules/zeroconf { };
··· 9067 python3 = python; 9068 })).py; 9069 9070 zeroc-ice = callPackage ../development/python-modules/zeroc-ice { }; 9071 9072 zeroconf = callPackage ../development/python-modules/zeroconf { };