move netdata to monitoring component

This commit is contained in:
Ingolf Wagner 2023-12-29 17:03:35 +01:00
commit 12f2bf4bf8
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
11 changed files with 60 additions and 36 deletions
nixos/components

View file

@ -4,6 +4,7 @@
./gui
./mainUser.nix
./media
./monitor
./network
./nixos
./terminal

View file

@ -0,0 +1,20 @@
{ lib, ... }:
with lib;
with types;
{
options.components.monitor = {
enable = mkOption {
type = bool;
default = true;
};
};
imports = [
./netdata.nix
];
config = mkIf config.components.monitor.enable { };
}

View file

@ -0,0 +1,33 @@
{ lib, pkgs, config, ... }:
with lib;
with types;
{
config = lib.mkIf config.components.monitor.enable {
services.netdata = {
enable = lib.mkDefault true;
# https://docs.netdata.cloud/daemon/config/
config = {
global = {
"memory mode" = "ram";
};
};
#configDir."python.d.conf" = pkgs.writeText "python.d.conf" ''
# example: yes
# default_run: no
# samba: yes
#'';
};
# add samba to path of python plugin
#systemd.services.netdata.path = [ pkgs.sudo pkgs.samba ];
#systemd.services.netdata.serviceConfig.CapabilityBoundingSet = [ "~" ];
#security.sudo.extraConfig = ''
# netdata ALL=(root) NOPASSWD: ${pkgs.samba}/bin/smbstatus
# netdata ALL=(root) NOPASSWD: /run/current-system/sw/bin/smbstatus
#'';
};
}