1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-02 18:42:15 +00:00
nixpkgs/nixos/modules/programs/atop.nix

37 lines
616 B
Nix
Raw Normal View History

# 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 != {}) {
2019-08-13 22:52:01 +01:00
environment.etc.atoprc.text =
concatStrings (mapAttrsToList (n: v: "${n} ${toString v}\n") cfg.settings);
};
}