fork/home-manager

git clone https://git.julia.blue/fork/home-manager

Robert HelgessonMerge PR #421575790441

master
1.4 KiB60 linesraw
1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6
7  cfg = config.programs.bottom;
8
9  tomlFormat = pkgs.formats.toml { };
10
11in {
12  options = {
13    programs.bottom = {
14      enable = mkEnableOption ''
15        bottom, a cross-platform graphical process/system monitor with a
16        customizable interface'';
17
18      package = mkOption {
19        type = types.package;
20        default = pkgs.bottom;
21        defaultText = literalExpression "pkgs.bottom";
22        description = "Package providing {command}`bottom`.";
23      };
24
25      settings = mkOption {
26        type = tomlFormat.type;
27        default = { };
28        description = ''
29          Configuration written to
30          {file}`$XDG_CONFIG_HOME/bottom/bottom.toml`.
31
32          See <https://github.com/ClementTsang/bottom/blob/master/sample_configs/default_config.toml>
33          for the default configuration.
34        '';
35        example = literalExpression ''
36          {
37            flags = {
38              avg_cpu = true;
39              temperature_type = "c";
40            };
41
42            colors = {
43              low_battery_color = "red";
44            };
45          }
46        '';
47      };
48    };
49  };
50
51  config = mkIf cfg.enable {
52    home.packages = [ cfg.package ];
53
54    xdg.configFile."bottom/bottom.toml" = mkIf (cfg.settings != { }) {
55      source = tomlFormat.generate "bottom.toml" cfg.settings;
56    };
57  };
58
59  meta.maintainers = [ maintainers.polykernel ];
60}