2013-05-23 15:04:07 +04:00
|
|
|
# Global configuration for atop.
|
|
|
|
|
2014-04-14 18:26:48 +04:00
|
|
|
{ config, lib, pkgs, ... }:
|
2013-05-23 15:04:07 +04:00
|
|
|
|
2014-04-14 18:26:48 +04:00
|
|
|
with lib;
|
2013-05-23 15:04:07 +04: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 23:23:14 +04:00
|
|
|
Parameters to be written to <filename>/etc/atoprc</filename>.
|
2013-05-23 15:04:07 +04:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf (cfg.settings != {}) {
|
|
|
|
environment.etc."atoprc".text =
|
|
|
|
concatStrings (mapAttrsToList (n: v: "${n} ${toString v}\n") cfg.settings);
|
|
|
|
};
|
|
|
|
}
|