summary refs log tree commit diff
diff options
context:
space:
mode:
authorFrederik Rietdijk <fridh@fridh.nl>2016-10-06 12:59:05 +0200
committerFrederik Rietdijk <fridh@fridh.nl>2016-10-06 12:59:05 +0200
commit6f836eb0d4df58bf2823c969a80909ec2aef89bf (patch)
tree5e7d98675b8e249fdb8bf547bee9d09f02f9588b
parent2fdda9ce0436d0f01e036f1e54ead722d2a5dfa0 (diff)
downloadnixlib-6f836eb0d4df58bf2823c969a80909ec2aef89bf.tar
nixlib-6f836eb0d4df58bf2823c969a80909ec2aef89bf.tar.gz
nixlib-6f836eb0d4df58bf2823c969a80909ec2aef89bf.tar.bz2
nixlib-6f836eb0d4df58bf2823c969a80909ec2aef89bf.tar.lz
nixlib-6f836eb0d4df58bf2823c969a80909ec2aef89bf.tar.xz
nixlib-6f836eb0d4df58bf2823c969a80909ec2aef89bf.tar.zst
nixlib-6f836eb0d4df58bf2823c969a80909ec2aef89bf.zip
Kippo: move pythonPackages.twisted_11 to kippo expression
-rw-r--r--nixos/modules/services/networking/kippo.nix6
-rw-r--r--pkgs/servers/kippo/default.nix40
-rw-r--r--pkgs/top-level/python-packages.nix31
3 files changed, 40 insertions, 37 deletions
diff --git a/nixos/modules/services/networking/kippo.nix b/nixos/modules/services/networking/kippo.nix
index 5f3efcd133a1..e3defd262f9a 100644
--- a/nixos/modules/services/networking/kippo.nix
+++ b/nixos/modules/services/networking/kippo.nix
@@ -54,7 +54,7 @@ rec {
   };
   config = mkIf cfg.enable {
     environment.systemPackages = with pkgs.pythonPackages; [
-      python twisted_11 pycrypto pyasn1 ];
+      python pkgs.kippo.twisted pycrypto pyasn1 ];
 
     environment.etc."kippo.cfg".text = ''
         # Automatically generated by NixOS.
@@ -84,7 +84,7 @@ rec {
       description = "Kippo Web Server";
       after = [ "network.target" ];
       wantedBy = [ "multi-user.target" ];
-      environment.PYTHONPATH = "${pkgs.kippo}/src/:${pkgs.pythonPackages.pycrypto}/lib/python2.7/site-packages/:${pkgs.pythonPackages.pyasn1}/lib/python2.7/site-packages/:${pkgs.pythonPackages.python}/lib/python2.7/site-packages/:${pkgs.pythonPackages.twisted_11}/lib/python2.7/site-packages/:.";
+      environment.PYTHONPATH = "${pkgs.kippo}/src/:${pkgs.pythonPackages.pycrypto}/lib/python2.7/site-packages/:${pkgs.pythonPackages.pyasn1}/lib/python2.7/site-packages/:${pkgs.pythonPackages.python}/lib/python2.7/site-packages/:${pkgs.kippo.twisted}/lib/python2.7/site-packages/:.";
       preStart = ''
         if [ ! -d ${cfg.varPath}/ ] ; then
             mkdir -p ${cfg.logPath}/tty
@@ -107,7 +107,7 @@ rec {
         fi
       '';
 
-      serviceConfig.ExecStart = "${pkgs.pythonPackages.twisted_11}/bin/twistd -y ${pkgs.kippo}/src/kippo.tac --syslog --rundir=${cfg.varPath}/ --pidfile=${cfg.pidPath}/kippo.pid --prefix=kippo -n";
+      serviceConfig.ExecStart = "${pkgs.kippo.twisted/bin/twistd -y ${pkgs.kippo}/src/kippo.tac --syslog --rundir=${cfg.varPath}/ --pidfile=${cfg.pidPath}/kippo.pid --prefix=kippo -n";
       serviceConfig.PermissionsStartOnly = true;
       serviceConfig.User = "kippo"; 
       serviceConfig.Group = "kippo"; 
diff --git a/pkgs/servers/kippo/default.nix b/pkgs/servers/kippo/default.nix
index 51630b4231ce..2e2923e17c39 100644
--- a/pkgs/servers/kippo/default.nix
+++ b/pkgs/servers/kippo/default.nix
@@ -25,16 +25,48 @@
 #
 # Use this package at your own risk.
 
-{stdenv, pkgs, config, fetchurl, ... }:
+{stdenv, fetchurl, pythonPackages }:
 
-stdenv.mkDerivation rec {
+let
+
+  twisted_13 = pythonPackages.buildPythonPackage rec {
+    # NOTE: When updating please check if new versions still cause issues
+    # to packages like carbon (http://stackoverflow.com/questions/19894708/cant-start-carbon-12-04-python-error-importerror-cannot-import-name-daem)
+    disabled = pythonPackages.isPy3k;
+
+    name = "Twisted-13.2.0";
+    src = fetchurl {
+      url = "mirror://pypi/T/Twisted/${name}.tar.bz2";
+      sha256 = "1wrcqv5lvgwk2aq83qb2s2ng2vx14hbjjk2gc30cg6h1iiipal89";
+    };
+
+    propagatedBuildInputs = with pythonPackages; [ zope_interface ];
+
+    # Generate Twisted's plug-in cache.  Twited users must do it as well.  See
+    # http://twistedmatrix.com/documents/current/core/howto/plugin.html#auto3
+    # and http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=477103 for
+    # details.
+    postInstall = "$out/bin/twistd --help > /dev/null";
+
+    meta = with stdenv.lib; {
+      homepage = http://twistedmatrix.com/;
+      description = "Twisted, an event-driven networking engine written in Python";
+      longDescription = ''
+        Twisted is an event-driven networking engine written in Python
+        and licensed under the MIT license.
+      '';
+      license = licenses.mit;
+    };
+  };
+
+in stdenv.mkDerivation rec {
     name = "kippo-${version}";
     version = "0.8";
     src = fetchurl {
       url = "https://kippo.googlecode.com/files/kippo-${version}.tar.gz";
       sha1 = "f57a5cf88171cb005afe44a4b33cb16f825c33d6";
     };
-    buildInputs = with pkgs.pythonPackages; [ pycrypto pyasn1 twisted_11 ];
+    buildInputs = with pythonPackages; [ pycrypto pyasn1 twisted_13 ];
     installPhase = ''
         substituteInPlace ./kippo.tac --replace "kippo.cfg" "$out/src/kippo.cfg"
         substituteInPlace ./kippo.cfg --replace "log_path = log" "log_path = /var/log/kippo" \
@@ -51,6 +83,8 @@ stdenv.mkDerivation rec {
         mv $out/src/utils/* $out/bin
         '';
 
+    passthru.twisted = twisted_13;
+
     meta = with stdenv.lib; {
       homepage = https://code.google.com/p/kippo;
       description = "SSH Honeypot";
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 70bb6d3c1736..d37f684c468e 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -24975,37 +24975,6 @@ in modules // {
     };
   };
 
-  twisted_11 = buildPythonPackage rec {
-    # NOTE: When updating please check if new versions still cause issues
-    # to packages like carbon (http://stackoverflow.com/questions/19894708/cant-start-carbon-12-04-python-error-importerror-cannot-import-name-daem)
-    disabled = isPy3k;
-
-    name = "Twisted-13.2.0";
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/T/Twisted/${name}.tar.bz2";
-      sha256 = "1wrcqv5lvgwk2aq83qb2s2ng2vx14hbjjk2gc30cg6h1iiipal89";
-    };
-
-    propagatedBuildInputs = with self; [ zope_interface ];
-
-    # Generate Twisted's plug-in cache.  Twited users must do it as well.  See
-    # http://twistedmatrix.com/documents/current/core/howto/plugin.html#auto3
-    # and http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=477103 for
-    # details.
-    postInstall = "$out/bin/twistd --help > /dev/null";
-
-    meta = {
-      homepage = http://twistedmatrix.com/;
-      description = "Twisted, an event-driven networking engine written in Python";
-      longDescription = ''
-        Twisted is an event-driven networking engine written in Python
-        and licensed under the MIT license.
-      '';
-      license = licenses.mit;
-      maintainers = [ ];
-    };
-  };
-
   twisted = buildPythonPackage rec {
 
     name = "Twisted-${version}";