at 18.09-beta 618 B view raw
1# Global configuration for atop. 2 3{ config, lib, ... }: 4 5with lib; 6 7let cfg = config.programs.atop; 8 9in 10{ 11 ###### interface 12 13 options = { 14 15 programs.atop = { 16 17 settings = mkOption { 18 type = types.attrs; 19 default = {}; 20 example = { 21 flags = "a1f"; 22 interval = 5; 23 }; 24 description = '' 25 Parameters to be written to <filename>/etc/atoprc</filename>. 26 ''; 27 }; 28 29 }; 30 }; 31 32 config = mkIf (cfg.settings != {}) { 33 environment.etc."atoprc".text = 34 concatStrings (mapAttrsToList (n: v: "${n} ${toString v}\n") cfg.settings); 35 }; 36}