diff --git a/modules/module-list.nix b/modules/module-list.nix index b6193b191314..476983b33044 100644 --- a/modules/module-list.nix +++ b/modules/module-list.nix @@ -36,6 +36,7 @@ ./misc/nixpkgs.nix ./misc/passthru.nix ./misc/version.nix + ./programs/atop.nix ./programs/bash/bash.nix ./programs/bash/command-not-found.nix ./programs/blcr.nix diff --git a/modules/programs/atop.nix b/modules/programs/atop.nix new file mode 100644 index 000000000000..7fdaab9d67df --- /dev/null +++ b/modules/programs/atop.nix @@ -0,0 +1,36 @@ +# 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 /etc/atoprc + ''; + }; + + }; + }; + + config = mkIf (cfg.settings != {}) { + environment.etc."atoprc".text = + concatStrings (mapAttrsToList (n: v: "${n} ${toString v}\n") cfg.settings); + }; +}