From 2bbe4e715be737e10aff00ff7d1676af81e39aa1 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Tue, 2 Mar 2021 12:26:06 +0100 Subject: [PATCH] sway: Decouple xdg.configFiles This also adds an empty let binding to the waybar config to avoid an upcoming commit to introduce a huge diff (twice, since this commit also would have reformatted the entire waybar configuration). --- users/simon/modules/sway.nix | 52 +++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/users/simon/modules/sway.nix b/users/simon/modules/sway.nix index b7bd7da..24ac1fc 100644 --- a/users/simon/modules/sway.nix +++ b/users/simon/modules/sway.nix @@ -271,9 +271,30 @@ lib.mkIf nixosConfig.sbruder.gui.enable { wdisplays # graphical output manager ]; - xdg.configFile = { - # home-manager’s waybar module performs additional checks that are overly strict - "waybar/config".text = lib.generators.toJSON { } { + # FIXME deduplicate (everything except text is redundant) + xdg.configFile."swaynag/config".text = '' + font=Monospace 12 + + [warning] + text=b58900 + background=fdf6e3 + border=eee8d5 + border-bottom=eee8d5 + button-background=eee8d5 + + [error] + text=dc322f + background=fdf6e3 + border=eee8d5 + border-bottom=eee8d5 + button-background=eee8d5 + ''; + + # home-manager’s waybar module performs additional checks that are overly strict + xdg.configFile."waybar/config".text = + let + in + lib.generators.toJSON { } { layer = "top"; position = "top"; height = 24; @@ -451,28 +472,9 @@ lib.mkIf nixosConfig.sbruder.gui.enable { tooltip-format = "{:%Y %B}\n{calendar}"; }; }; - "waybar/style.css".source = pkgs.substituteAll ({ - src = ../files/waybar/style.css; - } // solarized); - # FIXME deduplicate (everything except text is redundant) - "swaynag/config".text = '' - font=Monospace 12 - - [warning] - text=b58900 - background=fdf6e3 - border=eee8d5 - border-bottom=eee8d5 - button-background=eee8d5 - - [error] - text=dc322f - background=fdf6e3 - border=eee8d5 - border-bottom=eee8d5 - button-background=eee8d5 - ''; - }; + xdg.configFile."waybar/style.css".source = pkgs.substituteAll ({ + src = ../files/waybar/style.css; + } // solarized); systemd.user.services.waybar = { Unit = {