sway/swaynag: Deduplicate config

pull/48/head
Simon Bruder 2021-03-04 09:39:14 +01:00
parent da6788d036
commit 4d474043a0
Signed by: simon
GPG Key ID: 8D3C82F9F309F8EC
1 changed files with 19 additions and 16 deletions

View File

@ -270,24 +270,27 @@ lib.mkIf nixosConfig.sbruder.gui.enable {
wdisplays # graphical output manager
];
# FIXME deduplicate (everything except text is redundant)
xdg.configFile."swaynag/config".text = ''
font=Monospace 12
xdg.configFile."swaynag/config".text =
let
# adding it to the header doesnt work since the defaults overwrite it
commonConfig = ''
background=fdf6e3
border-bottom=eee8d5
border=eee8d5
button-background=eee8d5
'';
in
''
font=Monospace 12
[warning]
text=b58900
background=fdf6e3
border=eee8d5
border-bottom=eee8d5
button-background=eee8d5
[warning]
text=b58900
${commonConfig}
[error]
text=dc322f
background=fdf6e3
border=eee8d5
border-bottom=eee8d5
button-background=eee8d5
'';
[error]
text=dc322f
${commonConfig}
'';
# home-managers waybar module performs additional checks that are overly strict
xdg.configFile."waybar/config".text =