summary refs log blame commit diff
path: root/nixos/modules/programs/atop.nix
blob: 7ef8d687ca17f50088eb8462102d60623d6ce3c8 (plain) (tree)
1
2
3
4
5

                                
                     
 
         


















                               
                                                                       






                                      
                                 


                                                                                 
# Global configuration for atop.

{ config, lib, ... }:

with 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);
  };
}