diff --git a/nixos/modules/services/web-servers/zope2.nix b/nixos/modules/services/web-servers/zope2.nix index 19afa55d7fe..f75b62b219a 100644 --- a/nixos/modules/services/web-servers/zope2.nix +++ b/nixos/modules/services/web-servers/zope2.nix @@ -37,14 +37,14 @@ let default = '' - mount-point / - cache-size 30000 - - blob-dir /var/lib/zope2/${name}/blobstorage - - path /var/lib/zope2/${name}/filestorage/Data.fs - - + mount-point / + cache-size 30000 + + blob-dir /var/lib/zope2/${name}/blobstorage + + path /var/lib/zope2/${name}/filestorage/Data.fs + + ''; type = types.string; @@ -76,14 +76,14 @@ in extra = '' - mount-point / - cache-size 30000 - - blob-dir /var/lib/zope2/plone01/blobstorage - - path /var/lib/zope2/plone01/filestorage/Data.fs - - + mount-point / + cache-size 30000 + + blob-dir /var/lib/zope2/plone01/blobstorage + + path /var/lib/zope2/plone01/filestorage/Data.fs + + ''; @@ -107,32 +107,32 @@ in let interpreter = pkgs.writeScript "interpreter" '' -import sys + import sys -_interactive = True -if len(sys.argv) > 1: - _options, _args = __import__("getopt").getopt(sys.argv[1:], 'ic:m:') - _interactive = False - for (_opt, _val) in _options: - if _opt == '-i': - _interactive = True - elif _opt == '-c': - exec _val - elif _opt == '-m': - sys.argv[1:] = _args - _args = [] - __import__("runpy").run_module( - _val, {}, "__main__", alter_sys=True) + _interactive = True + if len(sys.argv) > 1: + _options, _args = __import__("getopt").getopt(sys.argv[1:], 'ic:m:') + _interactive = False + for (_opt, _val) in _options: + if _opt == '-i': + _interactive = True + elif _opt == '-c': + exec _val + elif _opt == '-m': + sys.argv[1:] = _args + _args = [] + __import__("runpy").run_module( + _val, {}, "__main__", alter_sys=True) - if _args: - sys.argv[:] = _args - __file__ = _args[0] - del _options, _args - execfile(__file__) + if _args: + sys.argv[:] = _args + __file__ = _args[0] + del _options, _args + execfile(__file__) -if _interactive: - del _interactive - __import__("code").interact(banner="", local=globals()) + if _interactive: + del _interactive + __import__("code").interact(banner="", local=globals()) ''; env = pkgs.buildEnv { name = "zope2-${name}-env"; @@ -149,73 +149,76 @@ if _interactive: ''; }; conf = pkgs.writeText "zope2-${name}-conf" - ''%define INSTANCEHOME ${env} -instancehome $INSTANCEHOME -%define CLIENTHOME /var/lib/zope2/${name} -clienthome $CLIENTHOME + '' + %define INSTANCEHOME ${env} + instancehome $INSTANCEHOME + %define CLIENTHOME /var/lib/zope2/${name} + clienthome $CLIENTHOME -debug-mode off -security-policy-implementation C -verbose-security off -default-zpublisher-encoding utf-8 -zserver-threads ${toString opts.threads} -effective-user ${opts.user} + debug-mode off + security-policy-implementation C + verbose-security off + default-zpublisher-encoding utf-8 + zserver-threads ${toString opts.threads} + effective-user ${opts.user} -pid-filename /var/lib/zope2/${name}/pid -lock-filename /var/lib/zope2/${name}/lock -python-check-interval 1000 -enable-product-installation off + pid-filename /var/lib/zope2/${name}/pid + lock-filename /var/lib/zope2/${name}/lock + python-check-interval 1000 + enable-product-installation off - - zope_i18n_compile_mo_files false - + + zope_i18n_compile_mo_files false + - -level INFO - - path /var/log/zope2/${name}.log - level INFO - - + + level INFO + + path /var/log/zope2/${name}.log + level INFO + + - -level WARN - - path /var/log/zope2/${name}-Z2.log - format %(message)s - - + + level WARN + + path /var/log/zope2/${name}-Z2.log + format %(message)s + + - -address ${opts.http_address} - + + address ${opts.http_address} + - - - name temporary storage for sessioning - -mount-point /temp_folder -container-class Products.TemporaryFolder.TemporaryContainer - + + + name temporary storage for sessioning + + mount-point /temp_folder + container-class Products.TemporaryFolder.TemporaryContainer + -${opts.extra} + ${opts.extra} ''; ctlScript = pkgs.writeScript "zope2-${name}-ctl-script" - ''#!${env}/bin/python + '' + #!${env}/bin/python -import sys -import plone.recipe.zope2instance.ctl + import sys + import plone.recipe.zope2instance.ctl -if __name__ == '__main__': - sys.exit(plone.recipe.zope2instance.ctl.main( - ["-C", "${conf}"] - + sys.argv[1:])) + if __name__ == '__main__': + sys.exit(plone.recipe.zope2instance.ctl.main( + ["-C", "${conf}"] + + sys.argv[1:])) ''; ctl = pkgs.writeScript "zope2-${name}-ctl" - ''#!${pkgs.bash}/bin/bash -e -export PYTHONHOME=${env} -exec ${ctlScript} "$@" + '' + #!${pkgs.bash}/bin/bash -e + export PYTHONHOME=${env} + exec ${ctlScript} "$@" ''; in { description = "zope2 ${name} instance";