From 9ea977e10455fc6cf3b0181a17e64a40794b3f13 Mon Sep 17 00:00:00 2001 From: Niklas Korz Date: Wed, 3 Jun 2026 09:02:18 +0200 Subject: [PATCH] nixos/weblate: ensure ssh wrappers are up to date Weblate generates an SSH wrapper with some preset options that uses the absolute path of the ssh binary internally. As the wrapper is only regenerated when the generator itself is changed, this absolute nix store path becomes unusable once ssh is updated and the path is garbage collected. As generating the wrappers is a quick operation, simply deleting the wrapper directory before service start ensures they are up to date. --- nixos/modules/services/web-apps/weblate.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/nixos/modules/services/web-apps/weblate.nix b/nixos/modules/services/web-apps/weblate.nix index 9ab21a8b7e52..f0a1e4b94fdc 100644 --- a/nixos/modules/services/web-apps/weblate.nix +++ b/nixos/modules/services/web-apps/weblate.nix @@ -9,6 +9,7 @@ let cfg = config.services.weblate; dataDir = "/var/lib/weblate"; + cacheDir = "${dataDir}/cache"; settingsDir = "${dataDir}/settings"; finalPackage = cfg.package.overridePythonAttrs (old: { @@ -362,6 +363,18 @@ in ]; inherit environment; path = weblatePath; + # Weblate generates SSH wrappers with some preset options that use the + # absolute paths of the ssh and scp binaries internally. + # As the wrapper is only regenerated when the generator itself is changed, + # this absolute nix store path becomes unusable once ssh is updated and + # the path is garbage collected. + # As generating the wrappers is a quick operation, simply deleting the + # wrapper directory before service start ensures they are up to date. + preStart = '' + if [ -d "${cacheDir}/ssh" ]; then + rm -r "${cacheDir}/ssh" + fi + ''; serviceConfig = { Type = "notify"; NotifyAccess = "all";