1
0
Fork 0

apply Nextcloud expensive migrations on service start

This commit is contained in:
ibizaman 2024-09-03 05:15:30 +02:00
parent e5b76e4183
commit 86151bc88e

View file

@ -560,6 +560,17 @@ in
This is useful if a deploy failed and you try to redeploy.
'';
};
alwaysApplyExpensiveMigrations = lib.mkOption {
type = lib.types.bool;
default = true;
description = ''
Run `occ maintenance:repair --include-expensive` on service start.
Larger instances should disable this and run the command at a convenient time
but Self Host Blocks assumes that it will not be the case for most users.
'';
};
};
config = lib.mkMerge [
@ -1007,5 +1018,14 @@ in
fi
'';
})
(lib.mkIf (cfg.enable && cfg.alwaysApplyExpensiveMigrations) {
systemd.services.nextcloud-setup.script =
''
if [[ -e /var/lib/nextcloud/config/config.php ]]; then
${occ} maintenance:repair --include-expensive
fi
'';
})
];
}