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