From 5c1f8cbc70cd5e6867ef6a2a06d27a40daa07010 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 10 Oct 2013 13:28:20 +0200 Subject: Move all of NixOS to nixos/ in preparation of the repository merge --- nixos/modules/programs/atop.nix | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 nixos/modules/programs/atop.nix (limited to 'nixos/modules/programs/atop.nix') diff --git a/nixos/modules/programs/atop.nix b/nixos/modules/programs/atop.nix new file mode 100644 index 00000000000..7fdaab9d67d --- /dev/null +++ b/nixos/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); + }; +} -- cgit 1.4.1