Skip to content

Instantly share code, notes, and snippets.

@ToxicFrog
Created December 13, 2018 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ToxicFrog/94d0aea25dbc0155c4aae1a4c4f111f7 to your computer and use it in GitHub Desktop.
Save ToxicFrog/94d0aea25dbc0155c4aae1a4c4f111f7 to your computer and use it in GitHub Desktop.
# Option definition
extraAutoPlugins = mkOption {
default = [];
type = with types; listOf path;
}
# Implementation detail; ${extraPluginDir} is referenced from a shell script that
# scans that directory for plugins at unit startup time.
extraPluginDir = pkgs.stdenv.mkDerivation {
name = "munin-extra-plugins.d";
buildCommand = ''
mkdir $out
${if nodeCfg.extraAutoPlugins == []
then "true"
else "cp -a -t $out/ ${toString nodeCfg.extraAutoPlugins}"}
'';
};
# configuration.nix entry
services.munin-node.extraAutoPlugins = [
/usr/src/munin-contrib/plugins/zfs/zfs_usage_
/usr/src/munin-contrib/plugins/zfs/zpool_iostat_
];
# Output of builder
building '/nix/store/l8lkdprmy17ym0nhj7gn5gpw333q73fr-munin-extra-plugins.d.drv'...
cp: cannot stat '/usr/src/munin-contrib/plugins/zfs/zfs_usage_': No such file or directory
cp: cannot stat '/usr/src/munin-contrib/plugins/zfs/zpool_iostat_': No such file or directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment