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:
parent
6c907851f4
commit
c4437fee7e
@ -24,6 +24,8 @@ let
|
|||||||
logdir /var/log/munin
|
logdir /var/log/munin
|
||||||
rundir /run/munin
|
rundir /run/munin
|
||||||
|
|
||||||
|
${lib.optionalString (cronCfg.extraCSS != "") "staticdir ${customStaticDir}"}
|
||||||
|
|
||||||
${cronCfg.extraGlobalConfig}
|
${cronCfg.extraGlobalConfig}
|
||||||
|
|
||||||
${cronCfg.hosts}
|
${cronCfg.hosts}
|
||||||
@ -114,6 +116,14 @@ let
|
|||||||
(map
|
(map
|
||||||
(path: { name = baseNameOf path; value = path; })
|
(path: { name = baseNameOf path; value = path; })
|
||||||
nodeCfg.extraAutoPlugins));
|
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
|
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);
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user