1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-01 00:39:45 +01:00
home-manager/tests/modules/programs/i3status-rust/with-default.nix
Robert Helgesson cb09a968e9
tests: add option test.stubs
This option provides a more convenient way to overlay dummy packages.
It also adds a function `config.lib.test.mkStubPackage` that can,
e.g., be used for `package` options.
2021-09-26 23:26:38 +02:00

54 lines
1.2 KiB
Nix

{ config, lib, pkgs, ... }:
with lib;
{
config = {
programs.i3status-rust = { enable = true; };
test.stubs.i3status-rust = { };
nmt.script = ''
assertFileExists home-files/.config/i3status-rust/config-default.toml
assertFileContent home-files/.config/i3status-rust/config-default.toml \
${
pkgs.writeText "i3status-rust-expected-config" ''
icons = "none"
theme = "plain"
[[block]]
alert = 10
alias = "/"
block = "disk_space"
info_type = "available"
interval = 60
path = "/"
unit = "GB"
warning = 20
[[block]]
block = "memory"
display_type = "memory"
format_mem = "{Mup}%"
format_swap = "{SUp}%"
[[block]]
block = "cpu"
interval = 1
[[block]]
block = "load"
format = "{1m}"
interval = 1
[[block]]
block = "sound"
[[block]]
block = "time"
format = "%a %d/%m %R"
interval = 60
''
}
'';
};
}