From 2c5867fcd3f7293a186476f6c305af3225462fe1 Mon Sep 17 00:00:00 2001 From: Patrick Mulligan Date: Wed, 1 Apr 2026 23:24:13 -0400 Subject: [PATCH] Fix duplicate fava package conflict with extensions Extensions like fava-dashboards depend on fava, causing a duplicate package error when added to fava's own dependencies. Strip the fava dependency from extensions since they're already running inside fava's Python environment. Co-Authored-By: Claude Opus 4.6 (1M context) --- fava.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/fava.nix b/fava.nix index 4abc344..f9958ef 100644 --- a/fava.nix +++ b/fava.nix @@ -5,10 +5,17 @@ with lib; let cfg = config.services.fava; - # Build fava with extensions included in its Python environment + # Build fava with extensions included in its Python environment. + # Extensions that depend on fava are overridden to remove it from their + # dependencies, avoiding duplicate package conflicts in the closure. + stripFavaDep = ext: ext.overridePythonAttrs (old: { + dependencies = builtins.filter (dep: (dep.pname or "") != "fava") (old.dependencies or []); + }); + favaWithExtensions = if cfg.extensions == [] then cfg.package else cfg.package.overridePythonAttrs (old: { - propagatedBuildInputs = (old.propagatedBuildInputs or []) ++ cfg.extensions; + dependencies = (old.dependencies or []) ++ map stripFavaDep cfg.extensions; + dontCheckForDuplicates = true; }); in {