mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 06:45:16 +01:00
37 lines
621 B
Nix
37 lines
621 B
Nix
|
# Global configuration for atop.
|
||
|
|
||
|
{config, pkgs, ...}:
|
||
|
|
||
|
with pkgs.lib;
|
||
|
|
||
|
let cfg = config.programs.atop;
|
||
|
|
||
|
in
|
||
|
{
|
||
|
###### interface
|
||
|
|
||
|
options = {
|
||
|
|
||
|
programs.atop = {
|
||
|
|
||
|
settings = mkOption {
|
||
|
type = types.attrs;
|
||
|
default = {};
|
||
|
example = {
|
||
|
flags = "a1f";
|
||
|
interval = 5;
|
||
|
};
|
||
|
description = ''
|
||
|
Parameters to be written to <filename>/etc/atoprc</filename>
|
||
|
'';
|
||
|
};
|
||
|
|
||
|
};
|
||
|
};
|
||
|
|
||
|
config = mkIf (cfg.settings != {}) {
|
||
|
environment.etc."atoprc".text =
|
||
|
concatStrings (mapAttrsToList (n: v: "${n} ${toString v}\n") cfg.settings);
|
||
|
};
|
||
|
}
|