From 6abc69d2cf9086e572b34e0803e84baff4ee4f46 Mon Sep 17 00:00:00 2001 From: Jennifer Graul Date: Mon, 23 Dec 2024 17:11:42 +0100 Subject: [PATCH] nixos/librenms: enable optimizations and view-cache Enables optimizations and view cache for the librenms module. Optimizations and view cache are both regenerated with each package update. --- nixos/modules/services/monitoring/librenms.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/monitoring/librenms.nix b/nixos/modules/services/monitoring/librenms.nix index 5275d61ecbdf6..6e7b5b3de4c87 100644 --- a/nixos/modules/services/monitoring/librenms.nix +++ b/nixos/modules/services/monitoring/librenms.nix @@ -603,10 +603,14 @@ in '' ) + '' - # clear cache after update + # clear cache after update and regenerate optimizations OLD_VERSION=$(cat ${cfg.dataDir}/version) if [[ $OLD_VERSION != "${package.version}" ]]; then rm -r ${cfg.dataDir}/cache/* + ${artisanWrapper}/bin/librenms-artisan view:clear + ${artisanWrapper}/bin/librenms-artisan optimize:clear + ${artisanWrapper}/bin/librenms-artisan view:cache + ${artisanWrapper}/bin/librenms-artisan optimize echo "${package.version}" > ${cfg.dataDir}/version fi