nixos/netdata: add config option for disabling analytics
Option disables analytics through the DO_NOT_TRACK environment variable, as detailed in https://learn.netdata.cloud/docs/agent/anonymous-statistics Default is analytics off
This commit is contained in:
parent
42fa68be1d
commit
5d81fcdf37
@ -123,9 +123,20 @@ in {
|
|||||||
"error log" = "syslog";
|
"error log" = "syslog";
|
||||||
};
|
};
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enableAnalyticsReporting = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
Enable reporting of anonymous usage statistics to Netdata Inc. via either
|
||||||
|
Google Analytics (in versions prior to 1.29.4), or Netdata Inc.'s
|
||||||
|
self-hosted PostHog (in versions 1.29.4 and later).
|
||||||
|
See: <link xlink:href="https://learn.netdata.cloud/docs/agent/anonymous-statistics"/>
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
assertions =
|
assertions =
|
||||||
@ -140,8 +151,12 @@ in {
|
|||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
path = (with pkgs; [ curl gawk which ]) ++ lib.optional cfg.python.enable
|
path = (with pkgs; [ curl gawk which ]) ++ lib.optional cfg.python.enable
|
||||||
(pkgs.python3.withPackages cfg.python.extraPackages);
|
(pkgs.python3.withPackages cfg.python.extraPackages);
|
||||||
|
environment = {
|
||||||
|
PYTHONPATH = "${cfg.package}/libexec/netdata/python.d/python_modules";
|
||||||
|
} // lib.optionalAttrs (!cfg.enableAnalyticsReporting) {
|
||||||
|
DO_NOT_TRACK = "1";
|
||||||
|
};
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Environment="PYTHONPATH=${cfg.package}/libexec/netdata/python.d/python_modules";
|
|
||||||
ExecStart = "${cfg.package}/bin/netdata -P /run/netdata/netdata.pid -D -c ${configFile}";
|
ExecStart = "${cfg.package}/bin/netdata -P /run/netdata/netdata.pid -D -c ${configFile}";
|
||||||
ExecReload = "${pkgs.util-linux}/bin/kill -s HUP -s USR1 -s USR2 $MAINPID";
|
ExecReload = "${pkgs.util-linux}/bin/kill -s HUP -s USR1 -s USR2 $MAINPID";
|
||||||
TimeoutStopSec = 60;
|
TimeoutStopSec = 60;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user