chore(nix): Prefer builtins.toJSON where possible

This commit is contained in:
Donovan Glover 2024-04-02 14:46:28 -04:00
parent 6dde83cea9
commit a4bdf7a076
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65

View File

@ -1,67 +1,65 @@
{ config, ... }: { config, ... }:
{ {
xdg.configFile."ironbar/config.json".text = /* json */ '' xdg.configFile."ironbar/config.json".text = builtins.toJSON {
{ name = "main";
"name": "main", icon_theme = "Fluent-dark";
"icon_theme": "Fluent-dark", position = "bottom";
"position": "bottom", anchor_to_edges = true;
"anchor_to_edges": true,
"start": [ start = [
{ {
"name": "startMenu", name = "startMenu";
"type": "label", type = "label";
"label": "", label = "";
"on_mouse_enter": "rofi -show drun" on_mouse_enter = "rofi -show drun";
}, }
{ {
"type": "script", type = "script";
"on_click_left": "notify-send -t 2000 \"Mullvad\" \"Changing location...\" && mullvad relay set location any && mullvad relay set location us", on_click_left = "notify-send -t 2000 \"Mullvad\" \"Changing location...\" && mullvad relay set location any && mullvad relay set location us";
"cmd": "mullvad status | choose 4.. | sed -e 's/Chicago.*//g' -e 's/Atlanta.*//g' -e 's/Miami.*//g' -e 's/Ashburn.*//g' -e 's/Boston.*//g' -e 's/Charlotte.*//g' -e 's/Cleveland.*//g' -e 's/Dallas.*//g' -e 's/Detroit.*//g' -e 's/Denver.*//g' -e 's/Honolulu.*//g' -e 's/Houston.*//g' -e 's/Jackson.*//g' -e 's/Los Angeles.*//g' -e 's/Louisville.*//g' -e 's/Milwaukee.*//g' -e 's/Minneapolis.*//g' -e 's/New York.*//g' -e 's/Oklahoma.*//g' -e 's/Philadelphia.*//g' -e 's/Phoenix.*//g' -e 's/Piscataway.*//g' -e 's/Portland.*//g' -e 's/Raleigh.*//g' -e 's/Richmond.*//g' -e 's/Salt Lake.*//g' -e 's/San Francisco.*//g' -e 's/San Jose.*//g' -e 's/Seattle.*//g' -e 's/Secaucus.*//g' -e 's/Sioux Falls.*//g' -e 's/St. Louis.*//g' -e 's/Stamford.*//g' -e 's/Washington.*//g'", cmd = "mullvad status | choose 4.. | sed -e 's/Chicago.*//g' -e 's/Atlanta.*//g' -e 's/Miami.*//g' -e 's/Ashburn.*//g' -e 's/Boston.*//g' -e 's/Charlotte.*//g' -e 's/Cleveland.*//g' -e 's/Dallas.*//g' -e 's/Detroit.*//g' -e 's/Denver.*//g' -e 's/Honolulu.*//g' -e 's/Houston.*//g' -e 's/Jackson.*//g' -e 's/Los Angeles.*//g' -e 's/Louisville.*//g' -e 's/Milwaukee.*//g' -e 's/Minneapolis.*//g' -e 's/New York.*//g' -e 's/Oklahoma.*//g' -e 's/Philadelphia.*//g' -e 's/Phoenix.*//g' -e 's/Piscataway.*//g' -e 's/Portland.*//g' -e 's/Raleigh.*//g' -e 's/Richmond.*//g' -e 's/Salt Lake.*//g' -e 's/San Francisco.*//g' -e 's/San Jose.*//g' -e 's/Seattle.*//g' -e 's/Secaucus.*//g' -e 's/Sioux Falls.*//g' -e 's/St. Louis.*//g' -e 's/Stamford.*//g' -e 's/Washington.*//g'";
"mode": "poll", mode = "poll";
"interval": 2500 interval = 2500;
} }
], ];
"center": [ center = [
{ {
"type": "launcher", type = "launcher";
"icon_size": 39, icon_size = 39;
"favorites": [ favorites = [
"librewolf", "librewolf"
"kitty", "kitty"
"thunar", "thunar"
"org.qutebrowser.qutebrowser", "org.qutebrowser.qutebrowser"
"anki", "anki"
"Element" "Element"
] ];
} }
], ];
"end": [ end = [
{ {
"type": "tray" type = "tray";
}, }
{ {
"type": "script", type = "script";
"cmd": "fish -c 'echo \"$(math \"$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | choose 1) * 100\")%\"'", cmd = "fish -c 'echo \"$(math \"$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | choose 1) * 100\")%\"'";
"mode": "poll", mode = "poll";
"interval": 2500 interval = 2500;
}, }
{ {
"type": "clock", type = "clock";
"format": "%x%a%R" format = "%x%a%R";
}, }
{ {
"name": "overview", name = "overview";
"type": "label", type = "label";
"label": "", label = "";
"on_mouse_enter": "hyprctl dispatch hycov:toggleoverview" on_mouse_enter = "hyprctl dispatch hycov:toggleoverview";
} }
] ];
} };
'';
xdg.configFile."ironbar/style.css".text = with config.lib.stylix.colors; /* css */ '' xdg.configFile."ironbar/style.css".text = with config.lib.stylix.colors; /* css */ ''
* { * {