diff --git a/nixos/modules/services/networking/firefox/sync-server.nix b/nixos/modules/services/networking/firefox/sync-server.nix index 97d223a56cab..2ae3226e924f 100644 --- a/nixos/modules/services/networking/firefox/sync-server.nix +++ b/nixos/modules/services/networking/firefox/sync-server.nix @@ -127,14 +127,16 @@ in config = mkIf cfg.enable { systemd.services.syncserver = let - syncServerEnv = pkgs.python.withPackages(ps: with ps; [ syncserver pasteScript requests ]); user = "syncserver"; group = "syncserver"; in { after = [ "network.target" ]; description = "Firefox Sync Server"; wantedBy = [ "multi-user.target" ]; - path = [ pkgs.coreutils syncServerEnv ]; + path = [ + pkgs.coreutils + (pkgs.python.withPackages (ps: [ pkgs.syncserver ps.pasteScript ps.requests ])) + ]; serviceConfig = { User = user; @@ -166,7 +168,9 @@ in chown ${user}:${group} ${defaultDbLocation} fi ''; - serviceConfig.ExecStart = "${syncServerEnv}/bin/paster serve ${syncServerIni}"; + script = '' + paster serve ${syncServerIni} + ''; }; users.users.syncserver = { diff --git a/pkgs/development/python-modules/syncserver/default.nix b/pkgs/development/python-modules/syncserver/default.nix deleted file mode 100644 index 7320a00a5575..000000000000 --- a/pkgs/development/python-modules/syncserver/default.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ stdenv -, buildPythonPackage -, fetchFromGitHub -, isPy27 -, unittest2 -, cornice -, gunicorn -, pyramid -, requests -, simplejson -, sqlalchemy -, mozsvc -, tokenserver -, serversyncstorage -, configparser -}: - -buildPythonPackage rec { - pname = "syncserver"; - version = "1.8.0"; - disabled = ! isPy27; - - src = fetchFromGitHub { - owner = "mozilla-services"; - repo = "syncserver"; - rev = version; - sha256 = "0hxjns9hz7a8r87iqr1yfvny4vwj1rlhwcf8bh7j6lsf92mkmgy8"; - }; - - buildInputs = [ unittest2 ]; - propagatedBuildInputs = [ - cornice gunicorn pyramid requests simplejson sqlalchemy mozsvc tokenserver - serversyncstorage configparser - ]; - - meta = with stdenv.lib; { - description = "Run-Your-Own Firefox Sync Server"; - homepage = "https://github.com/mozilla-services/syncserver"; - platforms = platforms.unix; - license = licenses.mpl20; - }; -} diff --git a/pkgs/servers/syncserver/default.nix b/pkgs/servers/syncserver/default.nix new file mode 100644 index 000000000000..d41923758017 --- /dev/null +++ b/pkgs/servers/syncserver/default.nix @@ -0,0 +1,47 @@ +{ lib +, python2 +, fetchFromGitHub +}: + +let + python = python2.override { + packageOverrides = self: super: { + # Older version, used by syncserver, tokenserver and serversyncstorage + cornice = super.cornice.overridePythonAttrs (oldAttrs: rec { + version = "0.17"; + src = oldAttrs.src.override { + inherit version; + sha256 = "1vvymhf6ydc885ygqiqpa39xr9v302i1l6nzirjnczqy9llyqvpj"; + }; + }); + }; + }; + +# buildPythonPackage is necessary for syncserver to work with gunicorn or paster scripts +in python.pkgs.buildPythonPackage rec { + pname = "syncserver"; + version = "1.8.0"; + + src = fetchFromGitHub { + owner = "mozilla-services"; + repo = "syncserver"; + rev = version; + sha256 = "0hxjns9hz7a8r87iqr1yfvny4vwj1rlhwcf8bh7j6lsf92mkmgy8"; + }; + + # There are no tests + doCheck = false; + + propagatedBuildInputs = with python.pkgs; [ + cornice gunicorn pyramid requests simplejson sqlalchemy mozsvc tokenserver + serversyncstorage configparser + ]; + + meta = with lib; { + description = "Run-Your-Own Firefox Sync Server"; + homepage = https://github.com/mozilla-services/syncserver; + platforms = platforms.unix; + license = licenses.mpl20; + maintainers = with maintainers; [ nadrieril ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 556dfcf0c040..d9b3b4c46096 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14138,6 +14138,8 @@ in systemd-journal2gelf = callPackage ../tools/system/systemd-journal2gelf { }; + syncserver = callPackage ../servers/syncserver { }; + inherit (callPackages ../servers/http/tomcat { }) tomcat7 tomcat8 diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d0e571686ea5..02db7bfc1954 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -774,8 +774,6 @@ in { supervise_api = callPackage ../development/python-modules/supervise_api { }; - syncserver = callPackage ../development/python-modules/syncserver {}; - tables = callPackage ../development/python-modules/tables { hdf5 = pkgs.hdf5.override { zlib = pkgs.zlib; }; };