mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-16 17:14:00 +00:00
nixos/pretalx: add plugins option
Allow loading pretalx plugins in a declarative manner. They are passed into the package dependencies at build time, so that collectstatic and other django maintenance functions account for them, since we cannot regenerate assets at runtime anyway.
This commit is contained in:
parent
110e635afb
commit
f4f9f96037
@ -11,14 +11,19 @@ let
|
||||
|
||||
configFile = format.generate "pretalx.cfg" cfg.settings;
|
||||
|
||||
extras = cfg.package.optional-dependencies.redis
|
||||
++ lib.optionals (cfg.settings.database.backend == "mysql") cfg.package.optional-dependencies.mysql
|
||||
++ lib.optionals (cfg.settings.database.backend == "postgresql") cfg.package.optional-dependencies.postgres;
|
||||
finalPackage = cfg.package.override {
|
||||
inherit (cfg) plugins;
|
||||
};
|
||||
|
||||
pythonEnv = cfg.package.python.buildEnv.override {
|
||||
extraLibs = [ (cfg.package.python.pkgs.toPythonModule cfg.package) ]
|
||||
++ (with cfg.package.python.pkgs; [ gunicorn ]
|
||||
++ lib.optional cfg.celery.enable celery) ++ extras;
|
||||
pythonEnv = finalPackage.python.buildEnv.override {
|
||||
extraLibs = with finalPackage.python.pkgs; [
|
||||
(toPythonModule finalPackage)
|
||||
gunicorn
|
||||
]
|
||||
++ finalPackage.optional-dependencies.redis
|
||||
++ lib.optionals cfg.celery.enable [ celery ]
|
||||
++ lib.optionals (cfg.settings.database.backend == "mysql") finalPackage.optional-dependencies.mysql
|
||||
++ lib.optionals (cfg.settings.database.backend == "postgresql") finalPackage.optional-dependencies.postgres;
|
||||
};
|
||||
in
|
||||
|
||||
@ -44,6 +49,20 @@ in
|
||||
description = "User under which pretalx should run.";
|
||||
};
|
||||
|
||||
plugins = lib.mkOption {
|
||||
type = with lib.types; listOf package;
|
||||
default = [];
|
||||
example = lib.literalExpression ''
|
||||
with config.services.pretalx.package.plugins; [
|
||||
pages
|
||||
youtube
|
||||
];
|
||||
'';
|
||||
description = ''
|
||||
Pretalx plugins to install into the Python environment.
|
||||
'';
|
||||
};
|
||||
|
||||
gunicorn.extraArgs = lib.mkOption {
|
||||
type = with lib.types; listOf str;
|
||||
default = [
|
||||
|
Loading…
Reference in New Issue
Block a user