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:
parent
2cfea84e6f
commit
4b964d2f7b
8 changed files with 139 additions and 0 deletions
4
tests/modules/programs/bottom/default.nix
Normal file
4
tests/modules/programs/bottom/default.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
bottom-empty-settings = ./empty-settings.nix;
|
||||
bottom-example-settings = ./example-settings.nix;
|
||||
}
|
||||
16
tests/modules/programs/bottom/empty-settings.nix
Normal file
16
tests/modules/programs/bottom/empty-settings.nix
Normal 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
|
||||
'';
|
||||
};
|
||||
}
|
||||
41
tests/modules/programs/bottom/example-settings.nix
Normal file
41
tests/modules/programs/bottom/example-settings.nix
Normal 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"
|
||||
''
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue