1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-03-10 18:57:22 +00:00
home-manager/tests/modules/programs/i3blocks/with-ordered-blocks.nix

62 lines
1.5 KiB
Nix
Raw Normal View History

{ config, lib, ... }:
2023-11-13 16:10:38 -08:00
let
expectedConfig = builtins.toFile "i3blocks-expected-config" ''
2023-11-13 16:10:38 -08:00
[block1first]
command=echo first
interval=1
[block3second]
command=echo second
interval=2
[block2third]
command=echo third
interval=3
'';
in {
config = {
programs.i3blocks = {
enable = true;
package = config.lib.test.mkStubPackage { };
bars = {
2023-11-13 16:10:38 -08:00
bar1 = {
block1first = {
command = "echo first";
interval = 1;
};
block2third = lib.hm.dag.entryAfter [ "block3second" ] {
2023-11-13 16:10:38 -08:00
command = "echo third";
interval = 3;
};
block3second = lib.hm.dag.entryAfter [ "block1first" ] {
2023-11-13 16:10:38 -08:00
command = "echo second";
interval = 2;
};
};
bar2 = {
block1first = {
command = "echo first";
interval = 1;
};
block2third = lib.hm.dag.entryAfter [ "block3second" ] {
2023-11-13 16:10:38 -08:00
command = "echo third";
interval = 3;
};
block3second = lib.hm.dag.entryAfter [ "block1first" ] {
2023-11-13 16:10:38 -08:00
command = "echo second";
interval = 2;
};
};
};
};
nmt.script = ''
assertFileExists home-files/.config/i3blocks/bar1
assertFileExists home-files/.config/i3blocks/bar2
assertFileContent home-files/.config/i3blocks/bar1 ${expectedConfig}
assertFileContent home-files/.config/i3blocks/bar2 ${expectedConfig}
'';
};
}