totoro: teach how to install grafana plugins from nix
This commit is contained in:
parent
ca4f3c0013
commit
405997d312
1 changed files with 13 additions and 0 deletions
|
@ -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";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue