nixos/pretalx: deduplicate packages
Reference only the final package throughout to not cause multiple pretalx builds.
This commit is contained in:
@@ -12,9 +12,7 @@ let
|
||||
|
||||
configFile = format.generate "pretalx.cfg" cfg.settings;
|
||||
|
||||
finalPackage = cfg.package.override {
|
||||
inherit (cfg) plugins;
|
||||
};
|
||||
inherit (cfg) finalPackage;
|
||||
|
||||
pythonEnv = finalPackage.python.buildEnv.override {
|
||||
extraLibs =
|
||||
@@ -41,6 +39,22 @@ in
|
||||
|
||||
package = lib.mkPackageOption pkgs "pretalx" { };
|
||||
|
||||
finalPackage = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = cfg.package.override {
|
||||
inherit (cfg) plugins;
|
||||
};
|
||||
defaultText = ''
|
||||
config.services.package.override {
|
||||
inherit (config.services.pretalx) plugins;
|
||||
}
|
||||
'';
|
||||
readOnly = true;
|
||||
description = ''
|
||||
The effective pretalx package used. This is the base package with the selected plugins applied.
|
||||
'';
|
||||
};
|
||||
|
||||
group = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "pretalx";
|
||||
@@ -220,8 +234,8 @@ in
|
||||
};
|
||||
static = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
default = "${cfg.package.static}/";
|
||||
defaultText = lib.literalExpression "\${config.services.pretalx.package}.static}/";
|
||||
default = "${finalPackage.static}/";
|
||||
defaultText = "\${config.services.pretalx.finalPackage.static}/";
|
||||
readOnly = true;
|
||||
description = ''
|
||||
Path to the directory that contains static files.
|
||||
@@ -442,7 +456,7 @@ in
|
||||
preStart =
|
||||
let
|
||||
versionString = lib.concatStringsSep "\n" (
|
||||
[ "pretalx-${cfg.package.version}" ]
|
||||
[ "pretalx-${cfg.finalPackage.version}" ]
|
||||
++ map (plugin: "${plugin.pname}-${plugin.version}") cfg.plugins
|
||||
);
|
||||
in
|
||||
|
||||
Reference in New Issue
Block a user