mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-19 20:21:14 +00:00
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
|
@ -124,6 +124,17 @@ in {
|
|||
};
|
||||
'';
|
||||
};
|
||||
|
||||
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"/>
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -140,8 +151,12 @@ in {
|
|||
wantedBy = [ "multi-user.target" ];
|
||||
path = (with pkgs; [ curl gawk which ]) ++ lib.optional cfg.python.enable
|
||||
(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 = {
|
||||
Environment="PYTHONPATH=${cfg.package}/libexec/netdata/python.d/python_modules";
|
||||
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";
|
||||
TimeoutStopSec = 60;
|
||||
|
|
Loading…
Reference in a new issue