forked from mirrors/nixpkgs
atop: Add basic config option for /etc/atoprc
This commit is contained in:
parent
70586f03fe
commit
76046850fe
|
@ -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
|
||||
|
|
36
modules/programs/atop.nix
Normal file
36
modules/programs/atop.nix
Normal file
|
@ -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 <filename>/etc/atoprc</filename>
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf (cfg.settings != {}) {
|
||||
environment.etc."atoprc".text =
|
||||
concatStrings (mapAttrsToList (n: v: "${n} ${toString v}\n") cfg.settings);
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue