btop: add module

This commit is contained in:
Gaetan Lepage 2022-08-17 18:16:01 +02:00 committed by Robert Helgesson
parent 960c009ce0
commit de079ec371
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
10 changed files with 140 additions and 0 deletions

View file

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

View file

@ -0,0 +1,11 @@
{ ... }:
{
programs.btop.enable = true;
test.stubs.btop = { };
nmt.script = ''
assertPathNotExists home-files/.config/btop
'';
}

View file

@ -0,0 +1,9 @@
disks_filter = "exclude=/foo/bar"
io_graph_combined = True
io_graph_speeds = ""
log_level = "DEBUG"
show_io_stat = False
update_ms = 1000
clock_format = "%H:%M"

View file

@ -0,0 +1,34 @@
{ config, ... }:
{
programs.btop = {
enable = true;
package = config.lib.test.mkStubPackage { };
settings = {
# Integer
update_ms = 1000;
# Boolean
show_io_stat = false;
io_graph_combined = true;
# String
disks_filter = "exclude=/foo/bar";
log_level = "DEBUG";
# Empty string
io_graph_speeds = "";
};
extraConfig = ''
clock_format = "%H:%M"
'';
};
nmt.script = ''
assertFileContent \
home-files/.config/btop/btop.conf \
${./example-settings-expected.conf}
'';
}