zerobin: 20160108 -> 1.0.5

This commit is contained in:
Julien Moutinho 2020-09-27 09:33:46 +02:00
parent 0090fbbda5
commit a9ce4c4a0e
6 changed files with 82 additions and 50 deletions

View file

@ -1486,11 +1486,12 @@ If you need to change a package's attribute(s) from `configuration.nix` you coul
nixpkgs.config.packageOverrides = super: { nixpkgs.config.packageOverrides = super: {
python = super.python.override { python = super.python.override {
packageOverrides = python-self: python-super: { packageOverrides = python-self: python-super: {
zerobin = python-super.zerobin.overrideAttrs (oldAttrs: { twisted = python-super.twisted.overrideAttrs (oldAttrs: {
src = super.fetchgit { src = super.fetchPipy {
url = "https://github.com/sametmax/0bin"; pname = "twisted";
rev = "a344dbb18fe7a855d0742b9a1cede7ce423b34ec"; version = "19.10.0";
sha256 = "16d769kmnrpbdr0ph0whyf4yff5df6zi4kmwx7sz1d3r6c8p6xji"; 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 `pythonPackages.twisted` is now globally overridden.
`zerobin` NixOS service use the new definition. Note that `python-super` refers All packages and also all NixOS services that reference `twisted`
to the old package set and `python-self` to the new, overridden version. (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 To modify only a Python package set instead of a whole Python derivation, use
this snippet: this snippet:
@ -1508,7 +1511,7 @@ this snippet:
```nix ```nix
myPythonPackages = pythonPackages.override { myPythonPackages = pythonPackages.override {
overrides = self: super: { overrides = self: super: {
zerobin = ...; twisted = ...;
}; };
} }
``` ```
@ -1521,11 +1524,12 @@ Use the following overlay template:
self: super: { self: super: {
python = super.python.override { python = super.python.override {
packageOverrides = python-self: python-super: { packageOverrides = python-self: python-super: {
zerobin = python-super.zerobin.overrideAttrs (oldAttrs: { twisted = python-super.twisted.overrideAttrs (oldAttrs: {
src = super.fetchgit { src = super.fetchPypi {
url = "https://github.com/sametmax/0bin"; pname = "twisted";
rev = "a344dbb18fe7a855d0742b9a1cede7ce423b34ec"; version = "19.10.0";
sha256 = "16d769kmnrpbdr0ph0whyf4yff5df6zi4kmwx7sz1d3r6c8p6xji"; sha256 = "7394ba7f272ae722a74f3d969dcf599bc4ef093bc392038748a490f1724a515d";
extension = "tar.bz2";
}; };
}); });
}; };

View file

@ -88,7 +88,7 @@ in
enable = true; enable = true;
after = [ "network.target" ]; after = [ "network.target" ];
wantedBy = [ "multi-user.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.PrivateTmp="yes";
serviceConfig.User = cfg.user; serviceConfig.User = cfg.user;
serviceConfig.Group = cfg.group; 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,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

@ -26288,6 +26288,8 @@ in
zathura = callPackage ../applications/misc/zathura { }; zathura = callPackage ../applications/misc/zathura { };
zerobin = callPackage ../applications/networking/zerobin { };
zeroc-ice = callPackage ../development/libraries/zeroc-ice { zeroc-ice = callPackage ../development/libraries/zeroc-ice {
inherit (darwin.apple_sdk.frameworks) Security; inherit (darwin.apple_sdk.frameworks) Security;
}; };

View file

@ -8571,8 +8571,6 @@ in {
zeitgeist = (toPythonModule (pkgs.zeitgeist.override { python3 = python; })).py; zeitgeist = (toPythonModule (pkgs.zeitgeist.override { python3 = python; })).py;
zerobin = callPackage ../development/python-modules/zerobin { };
zeroc-ice = callPackage ../development/python-modules/zeroc-ice { }; zeroc-ice = callPackage ../development/python-modules/zeroc-ice { };
zeroconf = callPackage ../development/python-modules/zeroconf { }; zeroconf = callPackage ../development/python-modules/zeroconf { };