aboutsummaryrefslogtreecommitdiff
path: root/tests/modules/programs/waybar/broken-settings.nix
diff options
context:
space:
mode:
authorNicolas Berbiche <nic.berbiche@gmail.com>2020-07-29 16:29:51 -0400
committerRobert Helgesson <robert@rycee.net>2020-08-14 00:20:49 +0200
commitf4f9f1a618eb7c19b765b02c235e13657b5aa150 (patch)
tree5843f7504ea42f568ecf3cd11d743a2f3b191a8c /tests/modules/programs/waybar/broken-settings.nix
parent2a54c353a9ee4c06866047b0abf0a418ab91a475 (diff)
waybar: add module
PR #1329
Diffstat (limited to 'tests/modules/programs/waybar/broken-settings.nix')
-rw-r--r--tests/modules/programs/waybar/broken-settings.nix80
1 files changed, 80 insertions, 0 deletions
diff --git a/tests/modules/programs/waybar/broken-settings.nix b/tests/modules/programs/waybar/broken-settings.nix
new file mode 100644
index 00000000000..68f0b90bfca
--- /dev/null
+++ b/tests/modules/programs/waybar/broken-settings.nix
@@ -0,0 +1,80 @@
+{ 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}
+ '';
+ };
+}