[Backport release-26.05] nixos/weblate: ensure ssh wrappers are up to date (#527524)

This commit is contained in:
Kerstin Humm 2026-06-03 14:08:46 +00:00 committed by GitHub
commit 5860264a88
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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";