Created
December 13, 2018 19:08
-
-
Save ToxicFrog/94d0aea25dbc0155c4aae1a4c4f111f7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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