2021-09-13 03:09:31 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.programs.bottom;
|
|
|
|
|
|
|
|
tomlFormat = pkgs.formats.toml { };
|
|
|
|
|
|
|
|
in {
|
|
|
|
options = {
|
|
|
|
programs.bottom = {
|
2023-07-02 01:45:18 +02:00
|
|
|
enable = mkEnableOption ''
|
2021-09-13 03:09:31 +02:00
|
|
|
bottom, a cross-platform graphical process/system monitor with a
|
2023-07-02 01:45:18 +02:00
|
|
|
customizable interface'';
|
2021-09-13 03:09:31 +02:00
|
|
|
|
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.bottom;
|
2021-10-09 11:14:08 +02:00
|
|
|
defaultText = literalExpression "pkgs.bottom";
|
2023-07-02 01:45:18 +02:00
|
|
|
description = "Package providing {command}`bottom`.";
|
2021-09-13 03:09:31 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
settings = mkOption {
|
|
|
|
type = tomlFormat.type;
|
|
|
|
default = { };
|
2023-07-02 01:45:18 +02:00
|
|
|
description = ''
|
2021-09-13 03:09:31 +02:00
|
|
|
Configuration written to
|
2023-07-01 01:30:13 +02:00
|
|
|
{file}`$XDG_CONFIG_HOME/bottom/bottom.toml`.
|
|
|
|
|
|
|
|
See <https://github.com/ClementTsang/bottom/blob/master/sample_configs/default_config.toml>
|
2021-09-13 03:09:31 +02:00
|
|
|
for the default configuration.
|
|
|
|
'';
|
2021-10-09 11:14:08 +02:00
|
|
|
example = literalExpression ''
|
2021-09-13 03:09:31 +02:00
|
|
|
{
|
|
|
|
flags = {
|
|
|
|
avg_cpu = true;
|
|
|
|
temperature_type = "c";
|
|
|
|
};
|
|
|
|
|
|
|
|
colors = {
|
|
|
|
low_battery_color = "red";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
home.packages = [ cfg.package ];
|
|
|
|
|
2023-04-14 11:36:38 +02:00
|
|
|
xdg.configFile."bottom/bottom.toml" = mkIf (cfg.settings != { }) {
|
2021-09-13 03:09:31 +02:00
|
|
|
source = tomlFormat.generate "bottom.toml" cfg.settings;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-07-28 17:58:33 +02:00
|
|
|
meta.maintainers = [ ];
|
2021-09-13 03:09:31 +02:00
|
|
|
}
|