From ba38feebb212a99e5392aa9304d9ffc263fdaa00 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 4 Dec 2025 01:13:35 +0100 Subject: [PATCH] nixos/pretalx: deduplicate packages Reference only the final package throughout to not cause multiple pretalx builds. --- nixos/modules/services/web-apps/pretalx.nix | 26 ++++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/nixos/modules/services/web-apps/pretalx.nix b/nixos/modules/services/web-apps/pretalx.nix index e54a003f4877..6ab037efb114 100644 --- a/nixos/modules/services/web-apps/pretalx.nix +++ b/nixos/modules/services/web-apps/pretalx.nix @@ -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