0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +03:00

nixos/munin: add extraCSS option

This permits custom styling of the generated HTML without needing to
build your own Munin package from source. Also comes with an example
that works as a passable dark theme for Munin.
This commit is contained in:
Ben Kelly 2018-12-13 21:55:41 -05:00 committed by Ben Kelly
parent 6c907851f4
commit c4437fee7e

View file

@ -24,6 +24,8 @@ let
logdir /var/log/munin
rundir /run/munin
${lib.optionalString (cronCfg.extraCSS != "") "staticdir ${customStaticDir}"}
${cronCfg.extraGlobalConfig}
${cronCfg.hosts}
@ -114,6 +116,14 @@ let
(map
(path: { name = baseNameOf path; value = path; })
nodeCfg.extraAutoPlugins));
customStaticDir = pkgs.runCommand "munin-custom-static-data" {} ''
cp -a "${pkgs.munin}/etc/opt/munin/static" "$out"
cd "$out"
chmod -R u+w .
echo "${cronCfg.extraCSS}" >> style.css
echo "${cronCfg.extraCSS}" >> style-new.css
'';
in
{
@ -266,6 +276,24 @@ in
'';
};
extraCSS = mkOption {
default = "";
type = types.lines;
description = ''
Custom styling for the HTML that munin-cron generates. This will be
appended to the CSS files used by munin-cron and will thus take
precedence over the builtin styles.
'';
example = ''
/* A simple dark theme. */
html, body { background: #222222; }
#header, #footer { background: #333333; }
img.i, img.iwarn, img.icrit, img.iunkn {
filter: invert(100%) hue-rotate(-30deg);
}
'';
};
};
};