nixos-module/collectd: fix TypesDB

This commit is contained in:
Astro 2021-04-07 23:58:05 +02:00
parent 494715acfe
commit d200cecb79
1 changed files with 9 additions and 3 deletions

View File

@ -1,9 +1,15 @@
{ hostName, config, lib, ... }: { hostName, config, lib, pkgs, ... }:
let let
hostRole = config.site.hosts.${hostName}.role; hostRole = config.site.hosts.${hostName}.role;
networkPort = 25826; networkPort = 25826;
typesDb = builtins.toFile "types.db" '' upstreamTypesDb = pkgs.stdenv.mkDerivation {
name = "types.db";
src = config.services.collectd.package.src;
phases = [ "unpackPhase" "installPhase" ];
installPhase = "cp src/types.db $out";
};
customTypesDb = builtins.toFile "types.db" ''
stations value:GAUGE:0:U stations value:GAUGE:0:U
''; '';
in in
@ -13,7 +19,7 @@ in
buildMinimalPackage = true; buildMinimalPackage = true;
extraConfig = '' extraConfig = ''
TypesDB ${config.services.collectd.package.src}/src/types.db ${typesDb} TypesDB ${upstreamTypesDb} ${customTypesDb}
''; '';
plugins = lib.mkMerge [ { plugins = lib.mkMerge [ {