more cleanup
This commit is contained in:
53
modules/nixos/monitoring/default.nix
Normal file
53
modules/nixos/monitoring/default.nix
Normal file
@@ -0,0 +1,53 @@
|
||||
{
|
||||
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;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user