2013-05-23 13:04:07 +02:00
|
|
|
# Global configuration for atop.
|
|
|
|
|
2018-07-20 22:56:59 +02:00
|
|
|
{ config, lib, ... }:
|
2013-05-23 13:04:07 +02:00
|
|
|
|
2014-04-14 16:26:48 +02:00
|
|
|
with lib;
|
2013-05-23 13:04:07 +02:00
|
|
|
|
|
|
|
let cfg = config.programs.atop;
|
|
|
|
|
|
|
|
in
|
|
|
|
{
|
|
|
|
###### interface
|
|
|
|
|
|
|
|
options = {
|
|
|
|
|
|
|
|
programs.atop = {
|
|
|
|
|
|
|
|
settings = mkOption {
|
|
|
|
type = types.attrs;
|
|
|
|
default = {};
|
|
|
|
example = {
|
|
|
|
flags = "a1f";
|
|
|
|
interval = 5;
|
|
|
|
};
|
|
|
|
description = ''
|
2014-06-24 21:23:14 +02:00
|
|
|
Parameters to be written to <filename>/etc/atoprc</filename>.
|
2013-05-23 13:04:07 +02:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf (cfg.settings != {}) {
|
2019-08-13 23:52:01 +02:00
|
|
|
environment.etc.atoprc.text =
|
2013-05-23 13:04:07 +02:00
|
|
|
concatStrings (mapAttrsToList (n: v: "${n} ${toString v}\n") cfg.settings);
|
|
|
|
};
|
|
|
|
}
|