1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-26 11:49:47 +01:00
home-manager/tests/modules/programs/waybar/broken-settings.nix
Nicolas Berbiche f4f9f1a618
waybar: add module
PR #1329
2020-08-14 00:20:49 +02:00

80 lines
1.7 KiB
Nix

{ config, lib, pkgs, ... }:
with lib;
let
package = pkgs.writeScriptBin "dummy-waybar" "" // { outPath = "@waybar@"; };
expected = pkgs.writeText "expected-json" ''
[
{
"height": 26,
"layer": "top",
"modules-center": [
"sway/window"
],
"modules-left": [
"sway/workspaces",
"sway/mode"
],
"modules-right": [
"idle_inhibitor",
"pulseaudio",
"network",
"cpu",
"memory",
"backlight",
"tray",
"clock"
],
"output": [
"DP-1",
"eDP-1",
"HEADLESS-1"
],
"position": "top",
"sway/workspaces": {
"all-outputs": true
}
}
]
'';
in {
config = {
programs.waybar = {
inherit package;
enable = true;
systemd.enable = true;
settings = [{
layer = "top";
position = "top";
height = 26;
output = [ "DP-1" "eDP-1" "HEADLESS-1" ];
modules-left = [ "sway/workspaces" "sway/mode" ];
modules-center = [ "sway/window" ];
modules-right = [
"idle_inhibitor"
"pulseaudio"
"network"
"cpu"
"memory"
"backlight"
"tray"
"clock"
];
modules = { "sway/workspaces".all-outputs = true; };
}];
};
nmt.description = ''
Test for the broken configuration
https://github.com/rycee/home-manager/pull/1329#issuecomment-653253069
'';
nmt.script = ''
assertPathNotExists home-files/.config/waybar/style.css
assertFileContent \
home-files/.config/waybar/config \
${expected}
'';
};
}