diff --git a/ops/nixos/totoro/default.nix b/ops/nixos/totoro/default.nix index 7caa231d77..f56fd28b1b 100644 --- a/ops/nixos/totoro/default.nix +++ b/ops/nixos/totoro/default.nix @@ -227,6 +227,19 @@ in { security.cookie_secure = "true"; }; }; + systemd.services.grafana.preStart = let + cfg = config.services.grafana; + plugins = with depot.pkgs.grafana-plugins; [ + grafana-piechart-panel + ]; + pluginLines = lib.concatMapStringsSep "\n" (pkg: '' + ln -sf ${pkg} ${cfg.dataDir}/plugins/${pkg.pname} + '') plugins; + in lib.mkAfter '' + rm -rf ${cfg.dataDir}/plugins + mkdir ${cfg.dataDir}/plugins + ${pluginLines} + ''; system.stateVersion = "20.03"; }