mirror of
https://github.com/nix-community/home-manager
synced 2024-12-24 02:39:48 +01:00
polybar: add test case
This commit is contained in:
parent
a6657d6b21
commit
f3fbb50b68
4 changed files with 71 additions and 0 deletions
|
@ -50,6 +50,7 @@ import nmt {
|
|||
./modules/programs/firefox
|
||||
./modules/programs/getmail
|
||||
./modules/programs/rofi
|
||||
./modules/services/polybar
|
||||
./modules/services/sxhkd
|
||||
./modules/services/window-managers/i3
|
||||
./modules/systemd
|
||||
|
|
21
tests/modules/services/polybar/basic-configuration.conf
Normal file
21
tests/modules/services/polybar/basic-configuration.conf
Normal file
|
@ -0,0 +1,21 @@
|
|||
[bar/top]
|
||||
height=3%
|
||||
modules-center=date
|
||||
monitor=${env:MONITOR:eDP1}
|
||||
radius=0
|
||||
width=100%
|
||||
|
||||
[module/date]
|
||||
date=%d.%m.%y
|
||||
internal=5
|
||||
label=%time% %date%
|
||||
time=%H:%M
|
||||
type=internal/date
|
||||
|
||||
[module/date]
|
||||
type = internal/date
|
||||
interval = 5
|
||||
date = "%d.%m.%y"
|
||||
time = %H:%M
|
||||
format-prefix-foreground = ${colors.foreground-alt}
|
||||
label = %time% %date%
|
48
tests/modules/services/polybar/basic-configuration.nix
Normal file
48
tests/modules/services/polybar/basic-configuration.nix
Normal file
|
@ -0,0 +1,48 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
config = {
|
||||
services.polybar = {
|
||||
enable = true;
|
||||
package = pkgs.writeScriptBin "dummy-polybar" "";
|
||||
script = "polybar bar &";
|
||||
config = {
|
||||
"bar/top" = {
|
||||
monitor = "\${env:MONITOR:eDP1}";
|
||||
width = "100%";
|
||||
height = "3%";
|
||||
radius = 0;
|
||||
modules-center = "date";
|
||||
};
|
||||
"module/date" = {
|
||||
type = "internal/date";
|
||||
internal = 5;
|
||||
date = "%d.%m.%y";
|
||||
time = "%H:%M";
|
||||
label = "%time% %date%";
|
||||
};
|
||||
};
|
||||
extraConfig = ''
|
||||
[module/date]
|
||||
type = internal/date
|
||||
interval = 5
|
||||
date = "%d.%m.%y"
|
||||
time = %H:%M
|
||||
format-prefix-foreground = ''${colors.foreground-alt}
|
||||
label = %time% %date%
|
||||
'';
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
local serviceFile=home-files/.config/systemd/user/polybar.service
|
||||
|
||||
assertFileExists $serviceFile
|
||||
assertFileRegex $serviceFile 'X-Restart-Triggers=.*polybar\.conf'
|
||||
assertFileRegex $serviceFile 'ExecStart=.*/bin/polybar-start'
|
||||
|
||||
assertFileExists home-files/.config/polybar/config
|
||||
assertFileContent home-files/.config/polybar/config \
|
||||
${./basic-configuration.conf}
|
||||
'';
|
||||
};
|
||||
}
|
1
tests/modules/services/polybar/default.nix
Normal file
1
tests/modules/services/polybar/default.nix
Normal file
|
@ -0,0 +1 @@
|
|||
{ polybar-basic-configuration = ./basic-configuration.nix; }
|
Loading…
Reference in a new issue