This commit is contained in:
commit
7d364cdfac
69 changed files with 5268 additions and 0 deletions
54
hosts/rx4/services/netdata.nix
Normal file
54
hosts/rx4/services/netdata.nix
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
{
|
||||
config,
|
||||
constants,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
services.netdata = {
|
||||
enable = true;
|
||||
config.global = {
|
||||
"debug log" = "syslog";
|
||||
"access log" = "syslog";
|
||||
"error log" = "syslog";
|
||||
};
|
||||
configDir = {
|
||||
"stream.conf" = config.sops.templates."netdata/stream.conf".path;
|
||||
};
|
||||
};
|
||||
|
||||
sops =
|
||||
let
|
||||
owner = config.services.netdata.user;
|
||||
group = config.services.netdata.group;
|
||||
mode = "0400";
|
||||
restartUnits = [ "netdata.service" ];
|
||||
in
|
||||
{
|
||||
# generate with `uuidgen`
|
||||
secrets."netdata/stream/rx4/uuid" = {
|
||||
inherit
|
||||
owner
|
||||
group
|
||||
mode
|
||||
restartUnits
|
||||
;
|
||||
};
|
||||
|
||||
templates."netdata/stream.conf" = {
|
||||
inherit
|
||||
owner
|
||||
group
|
||||
mode
|
||||
restartUnits
|
||||
;
|
||||
# child node
|
||||
content = ''
|
||||
[stream]
|
||||
enabled = yes
|
||||
destination = ${constants.hosts.sid.ip}:${builtins.toString constants.services.netdata.port}
|
||||
api key = ${config.sops.placeholder."netdata/stream/rx4/uuid"}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue