bottom: add module

Bottom is a cross-platform graphical process/system monitor with a
customizable interface and a multitude of features.

Two unit tests were added validate the module behavior for an empty
configuration and the example configuration.
This commit is contained in:
polykernel 2021-09-12 21:09:31 -04:00 committed by Robert Helgesson
parent 2cfea84e6f
commit 4b964d2f7b
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
8 changed files with 139 additions and 0 deletions

View file

@ -0,0 +1,4 @@
{
bottom-empty-settings = ./empty-settings.nix;
bottom-example-settings = ./example-settings.nix;
}

View file

@ -0,0 +1,16 @@
{ config, lib, pkgs, ... }:
with lib;
{
config = {
programs.bottom = {
enable = true;
package = pkgs.writeScriptBin "dummy" "";
};
nmt.script = ''
assertPathNotExists home-files/.config/bottom
'';
};
}

View file

@ -0,0 +1,41 @@
{ config, lib, pkgs, ... }:
with lib;
{
config = {
programs.bottom = {
enable = true;
package = pkgs.writeShellScriptBin "dummy" "";
settings = {
flags = {
avg_cpu = true;
temperature_type = "c";
};
colors = { low_battery_color = "red"; };
};
};
nmt.script = let
configDir = if pkgs.stdenv.isDarwin then
"home-files/Library/Application Support"
else
"home-files/.config";
in ''
assertFileContent \
"${configDir}/bottom/bottom.toml" \
${
builtins.toFile "example-settings-expected.toml" ''
[colors]
low_battery_color = "red"
[flags]
avg_cpu = true
temperature_type = "c"
''
}
'';
};
}