Merge pull request #98734 from ju1m/zerobin

This commit is contained in:
Doron Behar 2021-03-29 17:18:29 +00:00 committed by GitHub
commit c2b66f2702
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 97 additions and 59 deletions

View file

@ -1487,11 +1487,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";
};
});
};
@ -1499,9 +1500,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:
@ -1509,7 +1512,7 @@ this snippet:
```nix
myPythonPackages = pythonPackages.override {
overrides = self: super: {
zerobin = ...;
twisted = ...;
};
}
```
@ -1522,11 +1525,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";
};
});
};

View file

@ -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;

View file

@ -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 ];
};
}

View file

@ -1,6 +1,8 @@
{ lib
{ stdenv
, lib
, buildPythonPackage
, fetchFromGitHub
, glibcLocales
, nose
, pylibmc
, memcached
@ -19,14 +21,14 @@
buildPythonPackage rec {
pname = "Beaker";
version = "1.10.1";
version = "1.11.0";
# The pypy release do not contains the tests
src = fetchFromGitHub {
owner = "bbangert";
repo = "beaker";
rev = version;
sha256 = "0xrvg503xmi28w0hllr4s7fkap0p09fgw2wax3p1s2r6b3xjvbz7";
sha256 = "059sc7iar90lc2y9mppdis5ddfcxyirz03gmsfb0307f5dsa1dhj";
};
propagatedBuildInputs = [
@ -39,16 +41,16 @@ buildPythonPackage rec {
];
checkInputs = [
nose
mock
webtest
pylibmc
glibcLocales
memcached
redis
mock
nose
pylibmc
pymongo
redis
webtest
];
# Can not run memcached tests because it immediately tries to connect
postPatch = lib.optionalString isPy3k ''
substituteInPlace setup.py \
@ -66,6 +68,7 @@ buildPythonPackage rec {
nosetests \
-e ".*test_ext_.*" \
-e "test_upgrade" \
${lib.optionalString (!stdenv.isLinux) ''-e "test_cookie_expires_different_locale"''} \
-vv tests
'';

View file

@ -26,6 +26,9 @@ buildPythonPackage rec {
++ (lib.optionals (pythonOlder "3.4") [ enum34 pathlib ])
++ (lib.optionals (pythonOlder "2.7") [ ordereddict ]);
# Test suite is broken.
# See https://github.com/Kronuz/pyScss/issues/415
doCheck = false;
checkPhase = ''
py.test
'';

View file

@ -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;
};
}

View file

@ -26747,6 +26747,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;
};

View file

@ -9067,8 +9067,6 @@ in {
python3 = python;
})).py;
zerobin = callPackage ../development/python-modules/zerobin { };
zeroc-ice = callPackage ../development/python-modules/zeroc-ice { };
zeroconf = callPackage ../development/python-modules/zeroconf { };