diff --git a/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml index 82965ff1875..ea6c11b25d0 100644 --- a/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml +++ b/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml @@ -109,6 +109,13 @@ removed due to it being an outdated version. + + + The MoinMoin wiki engine + (services.moinmoin) has been removed, + because Python 2 is being retired from nixpkgs. + + The wafHook hook now honors diff --git a/nixos/doc/manual/release-notes/rl-2205.section.md b/nixos/doc/manual/release-notes/rl-2205.section.md index be9b57d1afe..3a56acf9fa9 100644 --- a/nixos/doc/manual/release-notes/rl-2205.section.md +++ b/nixos/doc/manual/release-notes/rl-2205.section.md @@ -43,6 +43,8 @@ In addition to numerous new and upgraded packages, this release has the followin - `services.kubernetes.addons.dashboard` was removed due to it being an outdated version. +- The MoinMoin wiki engine (`services.moinmoin`) has been removed, because Python 2 is being retired from nixpkgs. + - The `wafHook` hook now honors `NIX_BUILD_CORES` when `enableParallelBuilding` is not set explicitly. Packages can restore the old behaviour by setting `enableParallelBuilding=false`. - `pkgs.claws-mail-gtk2`, representing Claws Mail's older release version three, was removed in order to get rid of Python 2. diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 6fe6b41c609..dfdac4251a4 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -1029,7 +1029,6 @@ ./services/web-apps/pgpkeyserver-lite.nix ./services/web-apps/powerdns-admin.nix ./services/web-apps/matomo.nix - ./services/web-apps/moinmoin.nix ./services/web-apps/openwebrx.nix ./services/web-apps/restya-board.nix ./services/web-apps/sogo.nix diff --git a/nixos/modules/rename.nix b/nixos/modules/rename.nix index 8e1d6f7bc4a..c290741da04 100644 --- a/nixos/modules/rename.nix +++ b/nixos/modules/rename.nix @@ -24,6 +24,7 @@ with lib; (mkRemovedOptionModule [ "services" "firefox" "syncserver" "user" ] "") (mkRemovedOptionModule [ "services" "firefox" "syncserver" "group" ] "") (mkRemovedOptionModule [ "services" "marathon" ] "The corresponding package was removed from nixpkgs.") + (mkRemovedOptionModule [ "services" "moinmoin" ] "The corresponding package was removed from nixpkgs.") (mkRemovedOptionModule [ "services" "mesos" ] "The corresponding package was removed from nixpkgs.") (mkRemovedOptionModule [ "services" "winstone" ] "The corresponding package was removed from nixpkgs.") (mkRemovedOptionModule [ "networking" "vpnc" ] "Use environment.etc.\"vpnc/service.conf\" instead.") diff --git a/nixos/modules/services/web-apps/moinmoin.nix b/nixos/modules/services/web-apps/moinmoin.nix deleted file mode 100644 index efb73124a23..00000000000 --- a/nixos/modules/services/web-apps/moinmoin.nix +++ /dev/null @@ -1,304 +0,0 @@ -{ config, lib, pkgs, ... }: -with lib; - -let - cfg = config.services.moinmoin; - python = pkgs.python27; - pkg = python.pkgs.moinmoin; - dataDir = "/var/lib/moin"; - usingGunicorn = cfg.webServer == "nginx-gunicorn" || cfg.webServer == "gunicorn"; - usingNginx = cfg.webServer == "nginx-gunicorn"; - user = "moin"; - group = "moin"; - - uLit = s: ''u"${s}"''; - indentLines = n: str: concatMapStrings (line: "${fixedWidthString n " " " "}${line}\n") (splitString "\n" str); - - moinCliWrapper = wikiIdent: pkgs.writeShellScriptBin "moin-${wikiIdent}" '' - ${pkgs.su}/bin/su -s ${pkgs.runtimeShell} -c "${pkg}/bin/moin --config-dir=/var/lib/moin/${wikiIdent}/config $*" ${user} - ''; - - wikiConfig = wikiIdent: w: '' - # -*- coding: utf-8 -*- - - from MoinMoin.config import multiconfig, url_prefix_static - - class Config(multiconfig.DefaultConfig): - ${optionalString (w.webLocation != "/") '' - url_prefix_static = '${w.webLocation}' + url_prefix_static - ''} - - sitename = u'${w.siteName}' - page_front_page = u'${w.frontPage}' - - data_dir = '${dataDir}/${wikiIdent}/data' - data_underlay_dir = '${dataDir}/${wikiIdent}/underlay' - - language_default = u'${w.languageDefault}' - ${optionalString (w.superUsers != []) '' - superuser = [${concatMapStringsSep ", " uLit w.superUsers}] - ''} - - ${indentLines 4 w.extraConfig} - ''; - wikiConfigFile = name: wiki: pkgs.writeText "${name}.py" (wikiConfig name wiki); - -in -{ - options.services.moinmoin = with types; { - enable = mkEnableOption "MoinMoin Wiki Engine"; - - webServer = mkOption { - type = enum [ "nginx-gunicorn" "gunicorn" "none" ]; - default = "nginx-gunicorn"; - example = "none"; - description = '' - Which web server to use to serve the wiki. - Use none if you want to configure this yourself. - ''; - }; - - gunicorn.workers = mkOption { - type = ints.positive; - default = 3; - example = 10; - description = '' - The number of worker processes for handling requests. - ''; - }; - - wikis = mkOption { - type = attrsOf (submodule ({ name, ... }: { - options = { - siteName = mkOption { - type = str; - default = "Untitled Wiki"; - example = "ExampleWiki"; - description = '' - Short description of your wiki site, displayed below the logo on each page, and - used in RSS documents as the channel title. - ''; - }; - - webHost = mkOption { - type = str; - description = "Host part of the wiki URL. If undefined, the name of the attribute set will be used."; - example = "wiki.example.org"; - }; - - webLocation = mkOption { - type = str; - default = "/"; - example = "/moin"; - description = "Location part of the wiki URL."; - }; - - frontPage = mkOption { - type = str; - default = "LanguageSetup"; - example = "FrontPage"; - description = '' - Front page name. Set this to something like FrontPage once languages are - configured. - ''; - }; - - superUsers = mkOption { - type = listOf str; - default = []; - example = [ "elvis" ]; - description = '' - List of trusted user names with wiki system administration super powers. - - Please note that accounts for these users need to be created using the moin command-line utility, e.g.: - moin-WIKINAME account create --name=NAME --email=EMAIL --password=PASSWORD. - ''; - }; - - languageDefault = mkOption { - type = str; - default = "en"; - example = "de"; - description = "The ISO-639-1 name of the main wiki language. Languages that MoinMoin does not support are ignored."; - }; - - extraConfig = mkOption { - type = lines; - default = ""; - example = '' - show_hosts = True - search_results_per_page = 100 - acl_rights_default = u"Known:read,write,delete,revert All:read" - logo_string = u"

\U0001f639

" - theme_default = u"modernized" - - user_checkbox_defaults = {'show_page_trail': 0, 'edit_on_doubleclick': 0} - navi_bar = [u'SomePage'] + multiconfig.DefaultConfig.navi_bar - actions_excluded = multiconfig.DefaultConfig.actions_excluded + ['newaccount'] - - mail_smarthost = "mail.example.org" - mail_from = u"Example.Org Wiki " - ''; - description = '' - Additional configuration to be appended verbatim to this wiki's config. - - See for documentation. - ''; - }; - - }; - config = { - webHost = mkDefault name; - }; - })); - example = literalExpression '' - { - "mywiki" = { - siteName = "Example Wiki"; - webHost = "wiki.example.org"; - superUsers = [ "admin" ]; - frontPage = "Index"; - extraConfig = "page_category_regex = ur'(?P(Category|Kategorie)(?P(?!Template)\S+))'" - }; - } - ''; - description = '' - Configurations of the individual wikis. Attribute names must be valid Python - identifiers of the form [A-Za-z_][A-Za-z0-9_]*. - - For every attribute WIKINAME, a helper script - moin-WIKINAME is created which runs the - moin command under the moin user (to avoid - file ownership issues) and with the right configuration directory passed to it. - ''; - }; - }; - - config = mkIf cfg.enable { - assertions = forEach (attrNames cfg.wikis) (wname: - { assertion = builtins.match "[A-Za-z_][A-Za-z0-9_]*" wname != null; - message = "${wname} is not valid Python identifier"; - } - ); - - users.users = { - moin = { - description = "MoinMoin wiki"; - home = dataDir; - group = group; - isSystemUser = true; - }; - }; - - users.groups = { - moin = { - members = mkIf usingNginx [ config.services.nginx.user ]; - }; - }; - - environment.systemPackages = [ pkg ] ++ map moinCliWrapper (attrNames cfg.wikis); - - systemd.services = mkIf usingGunicorn - (flip mapAttrs' cfg.wikis (wikiIdent: wiki: - nameValuePair "moin-${wikiIdent}" - { - description = "MoinMoin wiki ${wikiIdent} - gunicorn process"; - wantedBy = [ "multi-user.target" ]; - after = [ "network.target" ]; - restartIfChanged = true; - restartTriggers = [ (wikiConfigFile wikiIdent wiki) ]; - - environment = let - penv = python.buildEnv.override { - # setuptools: https://github.com/benoitc/gunicorn/issues/1716 - extraLibs = [ python.pkgs.eventlet python.pkgs.setuptools pkg ]; - }; - in { - PYTHONPATH = "${dataDir}/${wikiIdent}/config:${penv}/${python.sitePackages}"; - }; - - preStart = '' - umask 0007 - rm -rf ${dataDir}/${wikiIdent}/underlay - cp -r ${pkg}/share/moin/underlay ${dataDir}/${wikiIdent}/ - chmod -R u+w ${dataDir}/${wikiIdent}/underlay - ''; - - startLimitIntervalSec = 30; - - serviceConfig = { - User = user; - Group = group; - WorkingDirectory = "${dataDir}/${wikiIdent}"; - ExecStart = ''${python.pkgs.gunicorn}/bin/gunicorn moin_wsgi \ - --name gunicorn-${wikiIdent} \ - --workers ${toString cfg.gunicorn.workers} \ - --worker-class eventlet \ - --bind unix:/run/moin/${wikiIdent}/gunicorn.sock - ''; - - Restart = "on-failure"; - RestartSec = "2s"; - - StateDirectory = "moin/${wikiIdent}"; - StateDirectoryMode = "0750"; - RuntimeDirectory = "moin/${wikiIdent}"; - RuntimeDirectoryMode = "0750"; - - NoNewPrivileges = true; - ProtectSystem = "strict"; - ProtectHome = true; - PrivateTmp = true; - PrivateDevices = true; - PrivateNetwork = true; - ProtectKernelTunables = true; - ProtectKernelModules = true; - ProtectControlGroups = true; - RestrictAddressFamilies = [ "AF_UNIX" "AF_INET" "AF_INET6" ]; - RestrictNamespaces = true; - LockPersonality = true; - MemoryDenyWriteExecute = true; - RestrictRealtime = true; - }; - } - )); - - services.nginx = mkIf usingNginx { - enable = true; - virtualHosts = flip mapAttrs' cfg.wikis (name: w: nameValuePair w.webHost { - forceSSL = mkDefault true; - enableACME = mkDefault true; - locations."${w.webLocation}" = { - extraConfig = '' - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-Host $host; - proxy_set_header X-Forwarded-Server $host; - - proxy_pass http://unix:/run/moin/${name}/gunicorn.sock; - ''; - }; - }); - }; - - systemd.tmpfiles.rules = [ - "d /run/moin 0750 ${user} ${group} - -" - "d ${dataDir} 0550 ${user} ${group} - -" - ] - ++ (concatLists (flip mapAttrsToList cfg.wikis (wikiIdent: wiki: [ - "d ${dataDir}/${wikiIdent} 0750 ${user} ${group} - -" - "d ${dataDir}/${wikiIdent}/config 0550 ${user} ${group} - -" - "L+ ${dataDir}/${wikiIdent}/config/wikiconfig.py - - - - ${wikiConfigFile wikiIdent wiki}" - # needed in order to pass module name to gunicorn - "L+ ${dataDir}/${wikiIdent}/config/moin_wsgi.py - - - - ${pkg}/share/moin/server/moin.wsgi" - # seed data files - "C ${dataDir}/${wikiIdent}/data 0770 ${user} ${group} - ${pkg}/share/moin/data" - # fix nix store permissions - "Z ${dataDir}/${wikiIdent}/data 0770 ${user} ${group} - -" - ]))); - }; - - meta.maintainers = with lib.maintainers; [ mmilata ]; -} diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 0dbd3671877..db526df392b 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -273,7 +273,6 @@ in misc = handleTest ./misc.nix {}; mjolnir = handleTest ./matrix/mjolnir.nix {}; mod_perl = handleTest ./mod_perl.nix {}; - moinmoin = handleTest ./moinmoin.nix {}; mongodb = handleTest ./mongodb.nix {}; moodle = handleTest ./moodle.nix {}; morty = handleTest ./morty.nix {}; diff --git a/nixos/tests/moinmoin.nix b/nixos/tests/moinmoin.nix deleted file mode 100644 index ac327498eba..00000000000 --- a/nixos/tests/moinmoin.nix +++ /dev/null @@ -1,28 +0,0 @@ -import ./make-test-python.nix ({ pkgs, lib, ... }: { - name = "moinmoin"; - meta.maintainers = with lib.maintainers; [ mmilata ]; - - machine = - { ... }: - { services.moinmoin.enable = true; - services.moinmoin.wikis.ExampleWiki.superUsers = [ "admin" ]; - services.moinmoin.wikis.ExampleWiki.webHost = "localhost"; - - services.nginx.virtualHosts.localhost.enableACME = false; - services.nginx.virtualHosts.localhost.forceSSL = false; - }; - - testScript = '' - start_all() - - machine.wait_for_unit("moin-ExampleWiki.service") - machine.wait_for_unit("nginx.service") - machine.wait_for_file("/run/moin/ExampleWiki/gunicorn.sock") - - assert "If you have just installed" in machine.succeed("curl -L http://localhost/") - - assert "status success" in machine.succeed( - "moin-ExampleWiki account create --name=admin --email=admin@example.com --password=foo 2>&1" - ) - ''; -}) diff --git a/pkgs/development/python-modules/moinmoin/default.nix b/pkgs/development/python-modules/moinmoin/default.nix deleted file mode 100644 index b4ecf28724a..00000000000 --- a/pkgs/development/python-modules/moinmoin/default.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ lib, buildPythonPackage, fetchurl, isPy3k -, pytest, werkzeug, pygments -}: - -buildPythonPackage rec { - pname = "moinmoin"; - version = "1.9.11"; - - # SyntaxError in setup.py - disabled = isPy3k; - - src = fetchurl { - url = "http://static.moinmo.in/files/moin-${version}.tar.gz"; - sha256 = "sha256-Ar4x1V851P4MYlPfi0ngG3bQlWNMvRtW0YX2bh4MPPU="; - }; - - patches = [ - # Recommended to install on their download page. - ./fix_tests.patch - ]; - - prePatch = '' - sed -i "s/\xfc/ΓΌ/" setup.cfg - ''; - - checkInputs = [ pytest werkzeug pygments ]; - - meta = with lib; { - description = "Advanced, easy to use and extensible WikiEngine"; - - homepage = "https://moinmo.in/"; - - license = licenses.gpl2Plus; - }; -} diff --git a/pkgs/development/python-modules/moinmoin/fix_tests.patch b/pkgs/development/python-modules/moinmoin/fix_tests.patch deleted file mode 100644 index e9856eeffca..00000000000 --- a/pkgs/development/python-modules/moinmoin/fix_tests.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -ru3 moin-1.9.9-old/MoinMoin/conftest.py moin-1.9.9-new/MoinMoin/conftest.py ---- moin-1.9.9-old/MoinMoin/conftest.py 2016-10-31 23:44:02.000000000 +0300 -+++ moin-1.9.9-new/MoinMoin/conftest.py 2018-02-18 12:13:19.551929093 +0300 -@@ -22,10 +22,11 @@ - - import atexit - import sys -+import os - - import py - --rootdir = py.magic.autopath().dirpath() -+rootdir = os.path.abspath(os.path.dirname(__file__)) - moindir = rootdir.join("..") - sys.path.insert(0, str(moindir)) - diff --git a/pkgs/top-level/python2-packages.nix b/pkgs/top-level/python2-packages.nix index 5efc4005373..1f894f3a14b 100644 --- a/pkgs/top-level/python2-packages.nix +++ b/pkgs/top-level/python2-packages.nix @@ -288,9 +288,6 @@ with self; with super; { mock = callPackage ../development/python-modules/mock/2.nix { }; - # Needed here because moinmoin is loaded as a Python library. - moinmoin = callPackage ../development/python-modules/moinmoin { }; - monosat = disabled super.monosat; more-itertools = callPackage ../development/python-modules/more-itertools/2.7.nix { };