54 lines
1.0 KiB
Nix
54 lines
1.0 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
namespace,
|
|
...
|
|
}:
|
|
let
|
|
cfg = config.${namespace}.monitoring;
|
|
in
|
|
{
|
|
options.${namespace}.monitoring = {
|
|
enable = lib.mkEnableOption "Common monitoring and system tools";
|
|
|
|
includeNetworkTools = lib.mkOption {
|
|
type = lib.types.bool;
|
|
default = true;
|
|
description = "Include network monitoring tools";
|
|
};
|
|
|
|
includePerformanceTools = lib.mkOption {
|
|
type = lib.types.bool;
|
|
default = true;
|
|
description = "Include performance monitoring tools";
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
environment.systemPackages =
|
|
with pkgs;
|
|
[
|
|
# Basic system monitoring
|
|
htop
|
|
|
|
]
|
|
++ lib.optionals cfg.includePerformanceTools [
|
|
glances
|
|
nmon
|
|
iotop
|
|
|
|
]
|
|
++ lib.optionals cfg.includeNetworkTools [
|
|
speedtest-cli
|
|
iftop
|
|
nethogs
|
|
tcpdump
|
|
wireshark-cli
|
|
];
|
|
|
|
# Enable common system services for monitoring
|
|
programs.screen.enable = lib.mkDefault true;
|
|
};
|
|
}
|