From c4673962ed3107dcdafe994056e59b02d85baf44 Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Mon, 8 Dec 2014 20:04:25 +0100 Subject: [PATCH 01/26] Add cornice 0.17.0 --- pkgs/top-level/python-packages.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index fcb7eb212a09..05e57b6723f4 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -821,6 +821,20 @@ let propagatedBuildInputs = with self; [ iowait psutil pyzmq tornado mock ]; }; + cornice = buildPythonPackage rec { + name = "cornice-${version}"; + version = "0.17.0"; + src = pkgs.fetchgit { + url = https://github.com/mozilla-services/cornice.git; + rev = "refs/tags/${version}"; + sha256 = "12yrcsv1sdl5w308y1cc939ppq7pi2490s54zfcbs481cvsyr1lg"; + }; + + propagatedBuildInputs = with self; [ pyramid simplejson ]; + + doCheck = false; # lazy packager + }; + cvxopt = buildPythonPackage rec { name = "${pname}-${version}"; pname = "cvxopt"; From 00913e355e2028b2b7f3923c07dd2c40d6263880 Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Mon, 8 Dec 2014 20:04:41 +0100 Subject: [PATCH 02/26] Add configparser 3.3.0r2 --- pkgs/top-level/python-packages.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 05e57b6723f4..6390c3116dee 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1521,6 +1521,21 @@ let }; }; + configparser = buildPythonPackage rec { + name = "configparser-${version}"; + version = "3.3.0r2"; + + src = pkgs.fetchurl { + url = "https://pypi.python.org/packages/source/c/configparser/${name}.tar.gz"; + sha256 = "6a2318590dfc4013fc5bf53c2bec14a8cb455a232295eb282a13f94786c4b0b2"; + }; + + meta = { + maintainers = [ ]; + platforms = stdenv.lib.platforms.all; + }; + }; + ColanderAlchemy = buildPythonPackage rec { name = "ColanderAlchemy-0.2.0"; From 44fbef6d443a775c05652f20f2bee4248f8a78b7 Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Mon, 8 Dec 2014 20:04:57 +0100 Subject: [PATCH 03/26] Add konfig 0.9 --- pkgs/top-level/python-packages.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6390c3116dee..12932f0aad6b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4836,6 +4836,24 @@ let }; }; + konfig = buildPythonPackage rec { + name = "konfig-${version}"; + version = "0.9"; + src = pkgs.fetchgit { + url = https://github.com/mozilla-services/konfig.git; + rev = "refs/tags/${version}"; + sha256 = "1v9pjb9idapjlc75p6h06kx7bi8zxhfgj93yxq1bn337kmyk1xdf"; + }; + + buildInputs = with self; [ configparser argparse ]; + + meta = with stdenv.lib; { + description = "Yet Another Config Parser"; + homepage = "https://github.com/mozilla-services/konfig"; + license = licenses.mpl20; + }; + }; + kitchen = buildPythonPackage (rec { name = "kitchen-1.1.1"; disabled = isPy3k; From e0a57ad7f106b72b23dfcb1b59a0f495203a37d7 Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Mon, 8 Dec 2014 20:05:14 +0100 Subject: [PATCH 04/26] Add mozservices 0.8 --- pkgs/top-level/python-packages.nix | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 12932f0aad6b..e725fcd944d7 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5410,7 +5410,6 @@ let }; }; - mox = buildPythonPackage rec { name = "mox-0.5.3"; @@ -5428,6 +5427,24 @@ let }; }; + mozsvc = buildPythonPackage rec { + name = "mozsvc-${version}"; + version = "0.8"; + + src = pkgs.fetchgit { + url = https://github.com/mozilla-services/mozservices.git; + rev = "refs/tags/${version}"; + sha256 = "0k1d7v8aa4xd3f9h8m5crl647136ba15i9nzdrpxg5aqmv2n0i0p"; + }; + + doCheck = false; # lazy packager + propagatedBuildInputs = with self; [ pyramid simplejson konfig ]; + + meta = { + homepage = https://github.com/mozilla-services/mozservices; + description = "Various utilities for Mozilla apps"; + }; + }; mpmath = buildPythonPackage rec { name = "mpmath-0.17"; From bb02daf594ccab7af3002b4bdc1a2ead6d93d88f Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Mon, 8 Dec 2014 20:15:48 +0100 Subject: [PATCH 05/26] Add PyBrowserID 0.9.2 --- pkgs/top-level/python-packages.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index e725fcd944d7..ea188d6843d1 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11155,6 +11155,24 @@ let propagatedBuildInputs = with self; [ pkgs.libarchive ]; }; + pybrowserid = buildPythonPackage rec { + name = "PyBrowserID-${version}"; + version = "0.9.2"; + src = pkgs.fetchgit { + url = https://github.com/mozilla/PyBrowserID.git; + rev = "refs/tags/${version}"; + sha256 = "1v9pjb9idapjlc75p6h06kx7bi8zxhfgj93yxq1bn337kmyk1xdf"; + }; + + buildInputs = with self; [ mock unittest2 argparse configparser ]; + propagatedBuildInputs = with self; [ requests ]; + + meta = with stdenv.lib; { + description = "Python library for the BrowserID Protocol"; + homepage = "https://github.com/mozilla/PyBrowserID"; + license = licenses.mpl20; + }; + }; pyzmq = buildPythonPackage rec { name = "pyzmq-13.0.0"; From 55cf2a36f2d536d8539f61bcedd4779056891659 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Mon, 8 Dec 2014 20:22:26 +0100 Subject: [PATCH 06/26] Fix the sha256 for PyBrowserID --- pkgs/top-level/python-packages.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ea188d6843d1..2c37db40ea69 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11161,10 +11161,10 @@ let src = pkgs.fetchgit { url = https://github.com/mozilla/PyBrowserID.git; rev = "refs/tags/${version}"; - sha256 = "1v9pjb9idapjlc75p6h06kx7bi8zxhfgj93yxq1bn337kmyk1xdf"; + sha256 = "0nyqb0v8yrkqnrqsh1hlhvzr2pyvkxvkw701p3gpsvk29c0gb5n6"; }; - buildInputs = with self; [ mock unittest2 argparse configparser ]; + buildInputs = with self; [ mock unittest2 ]; propagatedBuildInputs = with self; [ requests ]; meta = with stdenv.lib; { From 5f488a16ffa40171e7b3e5526e986504a8fc0014 Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Mon, 8 Dec 2014 21:07:46 +0100 Subject: [PATCH 07/26] Add tokenserver 1.2.11 --- pkgs/top-level/python-packages.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2c37db40ea69..6ded9f433708 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11184,6 +11184,28 @@ let doCheck = false; }; + tokenserver = buildPythonPackage rec { + name = "tokenserver-${version}"; + version = "1.2.11"; + + src = pkgs.fetchgit { + url = https://github.com/mozilla-services/tokenserver.git; + rev = "refs/tags/${version}"; + sha256 = "1pjrw7xhhqx7h4s08h1lsaa499r2ymc41zdknjimn6zlqdjdk1fb"; + }; + + doCheck = false; + propagatedBuildInputs = with self; [ cornice mozsvc pybrowserid ]; + + patchPhase = '' + sed -i "s|'testfixtures'||" setup.py + ''; + + meta = { + maintainers = [ ]; + platforms = stdenv.lib.platforms.all; + }; + }; tissue = buildPythonPackage rec { name = "tissue-0.9.2"; From b8bb7e6db9b585e9a076d53a156dc31528ca5699 Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Mon, 8 Dec 2014 21:25:04 +0100 Subject: [PATCH 08/26] Add memcache 1.6.3 --- pkgs/top-level/python-packages.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6ded9f433708..e698d02da889 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9887,6 +9887,22 @@ let }; }; + umemcache = buildPythonPackage rec { + name = "umemcache-${version}"; + version = "1.6.3"; + + src = pkgs.fetchurl { + url = "https://pypi.python.org/packages/source/u/umemcache/${name}.zip"; + sha256 = "211031a03576b7796bf277dbc9c9e3e754ba066bbb7fb601ab5c6291b8ec1918"; + }; + + meta = { + description = "Ultra fast memcache client written in highly optimized C++ with Python bindings"; + homepage = https://github.com/esnme/ultramemcache; + license = licenses.bsdOriginal; + }; + }; + unittest2 = buildPythonPackage rec { version = "0.5.1"; name = "unittest2-${version}"; From 45a785201878a1ced795c58c6f0797902a9f7007 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Mon, 8 Dec 2014 21:41:18 +0100 Subject: [PATCH 09/26] Add pyramid_hawkauth v 1.0 --- pkgs/top-level/python-packages.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index e698d02da889..d799051a6e87 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3022,6 +3022,18 @@ let }; }; + pyramid_hawkauth = buildPythonPackage rec { + name = "pyramidhawkauth-${version}"; + version = "0.1.0"; + src = pkgs.fetchgit { + url = https://github.com/mozilla-services/pyramid_hawkauth.git; + rev = "refs/tags/v${version}"; + sha256 = "1ic7xl72qnz382xaqhcy9ql17gx7pxbs78znp8xr66sp3dcx2s3c"; + }; + + propagatedBuildInputs = with self; [ pyramid hawkauthlib tokenlib webtest ]; + }; + radicale = buildPythonPackage rec { name = "radicale-${version}"; namePrefix = ""; From f448cff884d265f16c8b40b0654a37767a39da06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Mon, 8 Dec 2014 21:42:27 +0100 Subject: [PATCH 10/26] Add hawkauthlib v 0.1.1. --- pkgs/top-level/python-packages.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d799051a6e87..3d87012bf068 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4464,6 +4464,18 @@ let }; }; + hawkauthlib = buildPythonPackage rec { + name = "hawkauthlib-${version}"; + version = "0.1.1"; + src = pkgs.fetchgit { + url = https://github.com/mozilla-services/hawkauthlib.git; + rev = "refs/tags/v${version}"; + sha256 = "0b3xydii50ifs8qkgbpdlidfs2rzw63f807ahrq9flz90ahf582h"; + }; + + propagatedBuildInputs = with self; [ requests webob ]; + }; + hcs_utils = buildPythonPackage rec { name = "hcs_utils-1.5"; From d6247c98c311ad5057647510eb2209b247b2003e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Mon, 8 Dec 2014 21:44:06 +0100 Subject: [PATCH 11/26] Add pymysql v 0.6.3 --- pkgs/top-level/python-packages.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 3d87012bf068..98918d4be38e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5637,6 +5637,15 @@ let }; }); + pymysql = buildPythonPackage rec { + name = "pymysql-${version}"; + version = "0.6.3"; + src = pkgs.fetchgit { + url = https://github.com/PyMySQL/PyMySQL.git; + rev = "refs/tags/pymysql-${version}"; + sha256 = "1m9fr2x49s3aixlmccr3w80skl19dya9h3x69wgl6ly1z27iyg24"; + }; + }; MySQL_python = buildPythonPackage { name = "MySQL-python-1.2.3"; From 6a87d6b5b6b35af55fc75419873b181278114e87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Mon, 8 Dec 2014 21:45:32 +0100 Subject: [PATCH 12/26] Add pymysqlsa v 1.0 --- pkgs/top-level/python-packages.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 98918d4be38e..c82f1a3c968a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5647,6 +5647,24 @@ let }; }; + pymysqlsa = self.buildPythonPackage rec { + name = "pymysqlsa-${version}"; + version = "1.0"; + + propagatedBuildInputs = with self; [ pymysql sqlalchemy9 ]; + + src = pkgs.fetchurl { + url = "https://pypi.python.org/packages/source/p/pymysql_sa/pymysql_sa-1.0.tar.gz"; + sha256 = "a2676bce514a29b2d6ab418812259b0c2f7564150ac53455420a20bd7935314a"; + }; + + meta = { + description = "PyMySQL dialect for SQL Alchemy"; + homepage = https://pypi.python.org/pypi/pymysql_sa; + license = licenses.mit; + }; + }; + MySQL_python = buildPythonPackage { name = "MySQL-python-1.2.3"; From 9308db5b9e31d5de86d4dea0b2b7e067dc952581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Mon, 8 Dec 2014 21:45:59 +0100 Subject: [PATCH 13/26] Add tokenlib v 0.3.1 --- pkgs/top-level/python-packages.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c82f1a3c968a..85a696fd65d2 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11140,6 +11140,17 @@ let doCheck = false; }; + tokenlib = buildPythonPackage rec { + name = "tokenlib-${version}"; + version = "0.3.1"; + src = pkgs.fetchgit { + url = https://github.com/mozilla-services/tokenlib.git; + rev = "refs/tags/${version}"; + sha256 = "0dmq41sy64jmkj7n49jgbpii5n5d41ci263lyhqbff5slr289m51"; + }; + + propagatedBuildInputs = with self; [ requests webob ]; + }; tornadokick = buildPythonPackage rec { name = "tornadokick-0.2.1"; From ec58f0b0c53bec3a1b22483b2165878f71b37628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Mon, 8 Dec 2014 21:46:24 +0100 Subject: [PATCH 14/26] Add server-syncstorage v 1.5.11 --- pkgs/top-level/python-packages.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 85a696fd65d2..7bee47546b22 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -12145,6 +12145,24 @@ let }; }; + serversyncstorage = buildPythonPackage rec { + name = "serversyncstorage-${version}"; + version = "1.5.11"; + src = pkgs.fetchgit { + url = https://github.com/mozilla-services/server-syncstorage.git; + rev = "refs/tags/${version}"; + sha256 = "yrcsv1sdl5w308y1cc939ppq7pi2490s54zfcbs481cvsyr1lg22"; + }; + + propagatedBuildInputs = with self; [ + pyramid sqlalchemy9 simplejson mozsvc cornice pyramidhawkauth pymysql + mysqlsa umemcache wsgiproxy2 requests pybrowserid + ]; + + doCheck = false; # lazy packager + }; + + thumbor = self.buildPythonPackage rec { name = "thumbor-4.0.4"; From 428a83713b3e15c8c446d574ae5e8a97e300bc57 Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Mon, 8 Dec 2014 22:26:28 +0100 Subject: [PATCH 15/26] Add PasteScript 1.7.5 --- pkgs/top-level/python-packages.nix | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 7bee47546b22..60a739e07932 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6378,6 +6378,26 @@ let }; }; + pasteScript = buildPythonPackage rec { + version = "1.7.5"; + name = "PasterScript-${version}"; + + src = pkgs.fetchurl { + url = "http://pypi.python.org/packages/source/P/PasteScript/${name}.tar.gz"; + sha256 = "2b685be69d6ac8bc0fe6f558f119660259db26a15e16a4943c515fbee8093539"; + }; + + doCheck = false; + buildInputs = with self; [ nose ]; + propagatedBuildInputs = with self; [ paste paste_deploy cheetah ]; + + meta = { + description = "A pluggable command-line frontend, including commands to setup package file layouts"; + homepage = http://pythonpaste.org/script/; + platforms = stdenv.lib.platforms.all; + }; + }; + pathpy = buildPythonPackage rec { name = "path.py-5.2"; From e91929647511cba3767aefa1d8aa587ed4b6e58a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Mon, 8 Dec 2014 23:46:30 +0100 Subject: [PATCH 16/26] Add syncserver v1.5.0. Also fix some of the dependencies along the way. I'm like that. --- pkgs/top-level/python-packages.nix | 33 +++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 60a739e07932..3b0707aab13b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6370,6 +6370,7 @@ let }; buildInputs = with self; [ nose ]; + propagatedBuildInputs = with self; [ argparse configparser ]; meta = { description = "Load, configure, and compose WSGI applications and servers"; @@ -6389,7 +6390,7 @@ let doCheck = false; buildInputs = with self; [ nose ]; - propagatedBuildInputs = with self; [ paste paste_deploy cheetah ]; + propagatedBuildInputs = with self; [ paste paste_deploy cheetah argparse ]; meta = { description = "A pluggable command-line frontend, including commands to setup package file layouts"; @@ -11293,7 +11294,7 @@ let }; doCheck = false; - propagatedBuildInputs = with self; [ cornice mozsvc pybrowserid ]; + propagatedBuildInputs = with self; [ cornice mozsvc pybrowserid tokenlib ]; patchPhase = '' sed -i "s|'testfixtures'||" setup.py @@ -12165,18 +12166,40 @@ let }; }; + syncserver = buildPythonPackage rec { + name = "syncserver-${version}"; + version = "1.5.0"; + + src = pkgs.fetchgit { + url = https://github.com/mozilla-services/syncserver.git; + rev = "refs/tags/${version}"; + sha256 = "1xljylycxg7351hmqh7aa6fvvsjg06zvd4r7hcjqyd0k0sxvk7y6"; + }; + + buildInputs = with self; [ unittest2 ]; + propagatedBuildInputs = with self; [ + cornice gunicorn pyramid requests simplejson sqlalchemy9 mozsvc tokenserver + serversyncstorage configparser + ]; + + meta = { + maintainers = [ ]; + platforms = stdenv.lib.platforms.all; + }; + }; + serversyncstorage = buildPythonPackage rec { name = "serversyncstorage-${version}"; version = "1.5.11"; src = pkgs.fetchgit { url = https://github.com/mozilla-services/server-syncstorage.git; rev = "refs/tags/${version}"; - sha256 = "yrcsv1sdl5w308y1cc939ppq7pi2490s54zfcbs481cvsyr1lg22"; + sha256 = "1byq2k2f36f1jli9599ygfm2qsb4adl9140sxjpgfjbznb74q90q"; }; propagatedBuildInputs = with self; [ - pyramid sqlalchemy9 simplejson mozsvc cornice pyramidhawkauth pymysql - mysqlsa umemcache wsgiproxy2 requests pybrowserid + pyramid sqlalchemy9 simplejson mozsvc cornice pyramid_hawkauth pymysql + pymysqlsa umemcache wsgiproxy2 requests pybrowserid ]; doCheck = false; # lazy packager From c74c6360e07f997843db2b6377bea11e17c7bfa4 Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Thu, 11 Dec 2014 23:40:34 +0100 Subject: [PATCH 17/26] Fix konfig, in order to propagate its dependencies on configparser and argparse. --- pkgs/top-level/python-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 3b0707aab13b..568d0c88a9d5 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4869,7 +4869,7 @@ let sha256 = "1v9pjb9idapjlc75p6h06kx7bi8zxhfgj93yxq1bn337kmyk1xdf"; }; - buildInputs = with self; [ configparser argparse ]; + propagatedBuildInputs = with self; [ configparser argparse ]; meta = with stdenv.lib; { description = "Yet Another Config Parser"; From 0a0678cf5a7b3f6ea9b4f86fd875e6f2f9060f8b Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Thu, 11 Dec 2014 23:41:36 +0100 Subject: [PATCH 18/26] Fix mozsvc, such that we can split public/private parts of the configuration of the syncserver. --- pkgs/top-level/python-packages.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 568d0c88a9d5..06af327add67 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5461,6 +5461,11 @@ let sha256 = "0k1d7v8aa4xd3f9h8m5crl647136ba15i9nzdrpxg5aqmv2n0i0p"; }; + patches = singleton (pkgs.fetchurl { + url = https://github.com/nbp/mozservices/commit/f86c0b0b870cd8f80ce90accde9e16ecb2e88863.diff; + sha256 = "1lnghx821f6dqp3pa382ka07cncdz7hq0mkrh44d0q3grvrlrp9n"; + }); + doCheck = false; # lazy packager propagatedBuildInputs = with self; [ pyramid simplejson konfig ]; From 01886aef225a5fb03dc1ee08fb606899d87f6dcf Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Thu, 11 Dec 2014 23:48:15 +0100 Subject: [PATCH 19/26] Add Firefox Sync server module. --- nixos/modules/module-list.nix | 1 + .../networking/firefox/sync-server.nix | 135 ++++++++++++++++++ 2 files changed, 136 insertions(+) create mode 100644 nixos/modules/services/networking/firefox/sync-server.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index ecf68136f97b..cbf42d44df6e 100755 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -232,6 +232,7 @@ ./services/networking/dnscrypt-proxy.nix ./services/networking/dnsmasq.nix ./services/networking/ejabberd.nix + ./services/networking/firefox/sync-server.nix ./services/networking/firewall.nix ./services/networking/flashpolicyd.nix ./services/networking/freenet.nix diff --git a/nixos/modules/services/networking/firefox/sync-server.nix b/nixos/modules/services/networking/firefox/sync-server.nix new file mode 100644 index 000000000000..db249fe5a72f --- /dev/null +++ b/nixos/modules/services/networking/firefox/sync-server.nix @@ -0,0 +1,135 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.services.firefox.syncserver; + syncServerSecretFile = "/etc/firefox/syncserver-secret.ini"; + syncServerIni = pkgs.writeText "syncserver.ini" '' + [DEFAULT] + overrides = ${cfg.privateConfig} ${syncServerSecretFile} + + [server:main] + use = egg:Paste#http + host = ${cfg.listen.address} + port = ${toString cfg.listen.port} + + [app:main] + use = egg:syncserver + + [syncserver] + public_url = ${cfg.publicUrl} + ${optionalString (cfg.sqlUri != "") "sqluri = ${cfg.sqlUri}"} + allow_new_users = ${if cfg.allowNewUsers then "true" else "false"} + + [browserid] + backend = tokenserver.verifiers.LocalVerifier + audiences = ${removeSuffix "/" cfg.publicUrl} + ''; +in + +{ + options = { + services.firefox.syncserver = { + enable = mkOption { + type = types.bool; + default = false; + example = true; + description = '' + Whether to enable a Firefox Sync Server, this give the opportunity to + Firefox users to store all synchronized data on their own server. To use this + server, Firefox users should visit the , and + replicate the following change + + + services.sync.tokenServerURI: http://localhost:5000/token/1.0/sync/1.5 + + where corresponds to the + public url of the server. + ''; + }; + + listen.address = mkOption { + type = types.str; + default = "0.0.0.0"; + description = '' + Address on which the sync server listen to. + ''; + }; + + listen.port = mkOption { + type = types.int; + default = 5000; + description = '' + Port on which the sync server listen to. + ''; + }; + + publicUrl = mkOption { + type = types.str; + default = "http://localhost:5000/"; + example = "http://sync.example.com/"; + description = '' + Public URL with which firefox users can use to access the sync server. + ''; + }; + + allowNewUsers = mkOption { + type = types.bool; + default = true; + example = false; + description = '' + Whether to allow new-user signups on the server. Only request by + existing accounts will be honored. + ''; + }; + + sqlUri = mkOption { + type = types.str; + default = "sqlite:////var/db/firefox-sync-server.db"; + example = "postgresql://scott:tiger@localhost/test"; + description = '' + The location of the database. This URL is composed of + , + where is a database name such as + , , , + etc., and the name of a DBAPI, such as + , , , + etc. + ''; + }; + + privateConfig = mkOption { + type = types.separatedString " "; + default = ""; + description = '' + If defined, this file would be used to set all fields which were omitted in the + generated ini files used for configuring the syncserver. This file is useful + for storing secrets, such as the syncserver.secret or the syncserver.sqluri + ''; + }; + }; + }; + + config = { + + systemd.services.syncserver = { + after = [ "network.target" ]; + description = "Firefox Sync Server"; + wantedBy = [ "multi-user.target" ]; + path = [ pkgs.pythonPackages.pasteScript pkgs.coreutils ]; + environment.PYTHONPATH = "${pkgs.pythonPackages.syncserver}/lib/${pkgs.pythonPackages.python.libPrefix}/site-packages"; + preStart = '' + if ! test -e ${syncServerSecretFile}; then + mkdir -p $(dirname ${syncServerSecretFile}) + echo > ${syncServerSecretFile} '[syncserver]' + echo >> ${syncServerSecretFile} "secret = $(head -c 20 /dev/urandom | sha1sum | tr -d ' -')" + fi + ''; + serviceConfig.ExecStart = "paster serve ${syncServerIni}"; + serviceConfig.User = "deluge"; + serviceConfig.Group = "deluge"; + }; + + }; +} From b4ab60cd5e738889334fd2a2880ad6c5a120c585 Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Fri, 12 Dec 2014 21:52:14 +0100 Subject: [PATCH 20/26] configparser, konfig, umemcache and pybrowserid: Disable python 3 support. --- pkgs/top-level/python-packages.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b51254c1a7a2..65cb8782447b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1595,7 +1595,8 @@ let }; }; - configparser = buildPythonPackage rec { + # Backported version of the ConfigParser library of Python 3.3 + configparser = if isPy3k then null else buildPythonPackage rec { name = "configparser-${version}"; version = "3.3.0r2"; @@ -4988,6 +4989,11 @@ let konfig = buildPythonPackage rec { name = "konfig-${version}"; version = "0.9"; + + # konfig unconditionaly depend on configparser, even if it is part of + # the standard library in python 3.2 or above. + disabled = isPy3k; + src = pkgs.fetchgit { url = https://github.com/mozilla-services/konfig.git; rev = "refs/tags/${version}"; @@ -10154,6 +10160,7 @@ let umemcache = buildPythonPackage rec { name = "umemcache-${version}"; version = "1.6.3"; + disabled = isPy3k; src = pkgs.fetchurl { url = "https://pypi.python.org/packages/source/u/umemcache/${name}.zip"; @@ -11449,6 +11456,8 @@ let pybrowserid = buildPythonPackage rec { name = "PyBrowserID-${version}"; version = "0.9.2"; + disabled = isPy3k; # Errors in the test suite. + src = pkgs.fetchgit { url = https://github.com/mozilla/PyBrowserID.git; rev = "refs/tags/${version}"; From 15327098547ccb9a134d917cb1ea524646c9625a Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Fri, 12 Dec 2014 21:53:07 +0100 Subject: [PATCH 21/26] paste-deploy: Remove unnecessary propagated build inputs. --- pkgs/top-level/python-packages.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 65cb8782447b..3758c04f835d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6510,7 +6510,6 @@ let }; buildInputs = with self; [ nose ]; - propagatedBuildInputs = with self; [ argparse configparser ]; meta = { description = "Load, configure, and compose WSGI applications and servers"; From a0154145d52c27416c65d7c2289f3fae61182181 Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Fri, 12 Dec 2014 22:13:03 +0100 Subject: [PATCH 22/26] Firefox Sync Server: Fix copy&paste issue. --- nixos/modules/services/networking/firefox/sync-server.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/nixos/modules/services/networking/firefox/sync-server.nix b/nixos/modules/services/networking/firefox/sync-server.nix index db249fe5a72f..0d2306c69949 100644 --- a/nixos/modules/services/networking/firefox/sync-server.nix +++ b/nixos/modules/services/networking/firefox/sync-server.nix @@ -127,8 +127,6 @@ in fi ''; serviceConfig.ExecStart = "paster serve ${syncServerIni}"; - serviceConfig.User = "deluge"; - serviceConfig.Group = "deluge"; }; }; From 1a1fc17957516956949f019292b994aebfda6779 Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Fri, 12 Dec 2014 22:14:21 +0100 Subject: [PATCH 23/26] Firefox Sync Server: Create the private config file as non-world readable. --- .../networking/firefox/sync-server.nix | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/nixos/modules/services/networking/firefox/sync-server.nix b/nixos/modules/services/networking/firefox/sync-server.nix index 0d2306c69949..b357eac98b91 100644 --- a/nixos/modules/services/networking/firefox/sync-server.nix +++ b/nixos/modules/services/networking/firefox/sync-server.nix @@ -4,10 +4,9 @@ with lib; let cfg = config.services.firefox.syncserver; - syncServerSecretFile = "/etc/firefox/syncserver-secret.ini"; syncServerIni = pkgs.writeText "syncserver.ini" '' [DEFAULT] - overrides = ${cfg.privateConfig} ${syncServerSecretFile} + overrides = ${cfg.privateConfig} [server:main] use = egg:Paste#http @@ -100,12 +99,14 @@ in }; privateConfig = mkOption { - type = types.separatedString " "; - default = ""; + type = types.str; + default = "/etc/firefox/syncserver-secret.ini"; description = '' If defined, this file would be used to set all fields which were omitted in the generated ini files used for configuring the syncserver. This file is useful - for storing secrets, such as the syncserver.secret or the syncserver.sqluri + for storing secrets, such as the syncserver.secret or the syncserver.sqluri. + + If this file does not exists, it would be created with a unique secret. ''; }; }; @@ -120,10 +121,11 @@ in path = [ pkgs.pythonPackages.pasteScript pkgs.coreutils ]; environment.PYTHONPATH = "${pkgs.pythonPackages.syncserver}/lib/${pkgs.pythonPackages.python.libPrefix}/site-packages"; preStart = '' - if ! test -e ${syncServerSecretFile}; then - mkdir -p $(dirname ${syncServerSecretFile}) - echo > ${syncServerSecretFile} '[syncserver]' - echo >> ${syncServerSecretFile} "secret = $(head -c 20 /dev/urandom | sha1sum | tr -d ' -')" + if ! test -e ${cfg.privateConfig}; then + umask u=rwx,g=x,o=x + mkdir -p $(dirname ${cfg.privateConfig}) + echo > ${cfg.privateConfig} '[syncserver]' + echo >> ${cfg.privateConfig} "secret = $(head -c 20 /dev/urandom | sha1sum | tr -d ' -')" fi ''; serviceConfig.ExecStart = "paster serve ${syncServerIni}"; From 28f4ef2a5fda5d65e3567a0ab48ff17656cf9eac Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Sat, 13 Dec 2014 22:26:13 +0100 Subject: [PATCH 24/26] Disable configparser backport on pypy. --- pkgs/top-level/python-packages.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 3758c04f835d..294fe3f9e138 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1600,6 +1600,10 @@ let name = "configparser-${version}"; version = "3.3.0r2"; + # running install_egg_info + # error: [Errno 9] Bad file descriptor: '' + disabled = isPyPy; + src = pkgs.fetchurl { url = "https://pypi.python.org/packages/source/c/configparser/${name}.tar.gz"; sha256 = "6a2318590dfc4013fc5bf53c2bec14a8cb455a232295eb282a13f94786c4b0b2"; From 0d13ea0131cf43e7adccc437df4be8fa75ed9d3e Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Sun, 18 Jan 2015 12:20:44 +0100 Subject: [PATCH 25/26] Change default syncserver listen.port to a safer one. --- nixos/modules/services/networking/firefox/sync-server.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/networking/firefox/sync-server.nix b/nixos/modules/services/networking/firefox/sync-server.nix index b357eac98b91..58b07e51387e 100644 --- a/nixos/modules/services/networking/firefox/sync-server.nix +++ b/nixos/modules/services/networking/firefox/sync-server.nix @@ -50,7 +50,8 @@ in listen.address = mkOption { type = types.str; - default = "0.0.0.0"; + default = "127.0.0.1"; + example = "0.0.0.0"; description = '' Address on which the sync server listen to. ''; From 8196727fad8a7eabf26313bd3175c1ee9e8cca43 Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Sun, 18 Jan 2015 12:21:23 +0100 Subject: [PATCH 26/26] Improve the documentation of the syncserver module. --- .../networking/firefox/sync-server.nix | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/nixos/modules/services/networking/firefox/sync-server.nix b/nixos/modules/services/networking/firefox/sync-server.nix index 58b07e51387e..6ed7a6beb9e8 100644 --- a/nixos/modules/services/networking/firefox/sync-server.nix +++ b/nixos/modules/services/networking/firefox/sync-server.nix @@ -41,7 +41,8 @@ in replicate the following change - services.sync.tokenServerURI: http://localhost:5000/token/1.0/sync/1.5 + services.sync.tokenServerURI: http://localhost:5000/token/1.0/sync/1.5 + where corresponds to the public url of the server. @@ -95,7 +96,10 @@ in , , , etc., and the name of a DBAPI, such as , , , - etc. + etc. The + SQLAlchemy documentation provides more examples and describe the syntax of + the expected URL. ''; }; @@ -103,12 +107,14 @@ in type = types.str; default = "/etc/firefox/syncserver-secret.ini"; description = '' - If defined, this file would be used to set all fields which were omitted in the - generated ini files used for configuring the syncserver. This file is useful - for storing secrets, such as the syncserver.secret or the syncserver.sqluri. + The private config file is used to extend the generated config with confidential + information, such as the setting if it contains a + password, and the setting is used by the server to + generate cryptographically-signed authentication tokens. - If this file does not exists, it would be created with a unique secret. - ''; + If this file does not exists, then it is created with a generated + settings. + ''; }; }; };