My Nix Configuration
1{ 2 pkgs, 3 lib, 4 config, 5 ... 6}: 7let 8 cfg = config.py.gui; 9in 10{ 11 config = { 12 xdg.configFile."waybar/mocha.css" = lib.mkIf cfg.enable { 13 source = ./waybar-mocha.css; 14 recursive = false; 15 }; 16 catppuccin.waybar.enable = false; 17 programs.waybar = lib.mkIf cfg.enable { 18 enable = lib.mkDefault true; 19 systemd.enable = true; 20 systemd.target = "sway-session.target"; 21 style = ./waybar-style.css; 22 settings = { 23 mainBar = { 24 layer = "top"; 25 position = "top"; 26 height = 32; 27 modules-left = [ 28 "sway/workspaces" 29 "sway/mode" 30 ]; 31 modules-center = [ "mpris" ]; 32 modules-right = [ 33 "idle_inhibitor" 34 "wireplumber" 35 "network" 36 "temperature" 37 "backlight" 38 "battery" 39 "clock" 40 "tray" 41 ]; 42 "sway/workspaces" = { 43 disable-scroll = true; 44 enable-bar-scroll = false; 45 active-only = false; 46 all-outputs = false; 47 format = "{icon}"; 48 }; 49 "idle_inhibitor" = { 50 format = "{icon} "; 51 format-icons = { 52 "activated" = ""; 53 "deactivated" = ""; 54 }; 55 }; 56 "tray" = { 57 icon-size = 25; 58 spacing = 12; 59 }; 60 "clock" = { 61 tooltip-format = "<tt><small>{calendar}</small></tt>"; 62 format = " {:%H:%M:%S}"; 63 format-alt = "{%d %b %Y}"; 64 interval = 1; 65 calendar = { 66 format = { 67 today = "<span color='#89b4fa'><b><u>{}</u></b></span>"; 68 }; 69 }; 70 }; 71 "cpu" = { 72 format = " {usage}%"; 73 interval = 5; 74 tooltip = false; 75 }; 76 "memory" = { 77 format = " {}%"; 78 }; 79 "temperature" = { 80 critical-threshold = 80; 81 format = "{icon} {temperatureC}°C"; 82 format-icons = [ 83 "" 84 "" 85 "" 86 "" 87 "" 88 ]; 89 }; 90 "backlight" = { 91 format = "{icon} {percent}%"; 92 format-icons = [ 93 "󰃚" 94 "󰃛" 95 "󰃜" 96 "󰃝" 97 "󰃞" 98 "󰃟" 99 "󰃠" 100 ]; 101 }; 102 "battery" = { 103 states = { 104 good = 65; 105 warning = 30; 106 critical = 15; 107 }; 108 full-at = 80; 109 format = "{icon} {capacity}%"; 110 format-charging = "󰂄 {capacity}%"; 111 format-plugged = " {capacity}%"; 112 format-alt = "{icon} {time}"; 113 format-icons = [ 114 "󰂎" 115 "󰁺" 116 "󰁻" 117 "󰁼" 118 "󰁽" 119 "󰁾" 120 "󰁿" 121 "󰂀" 122 "󰂁" 123 "󰂂" 124 "󰁹" 125 ]; 126 }; 127 "network" = { 128 format-wifi = "<big></big> {essid}"; 129 format-ethernet = "󰈀 {ifname}: {ipaddr}/{cidr}"; 130 format-linked = "󰄡 {ifname} (No IP)"; 131 format-disconnected = " Disconnected!"; 132 format-alt = "{ifname}: {ipaddr}/{cidr}"; 133 on-click = lib.getExe pkgs.networkmanagerapplet; 134 }; 135 "wireplumber" = { 136 format = "{icon} {volume}%"; 137 format-muted = "󰝟"; 138 format-icons = [ 139 "" 140 "" 141 "" 142 ]; 143 states = { 144 low = 15; 145 med = 40; 146 high = 60; 147 }; 148 scroll-step = 5; 149 on-click = lib.getExe pkgs.pwvucontrol; 150 }; 151 mpris = { 152 format = "{status_icon} {dynamic}"; 153 max-length = 100; 154 format-paused = "{status_icon} <i>{dynamic}</i>"; 155 dynamic-order = [ 156 "artist" 157 "title" 158 ]; 159 status-icons = { 160 playing = ""; 161 paused = ""; 162 }; 163 player-icons = { 164 firefox = "󰈹"; 165 }; 166 }; 167 }; 168 }; 169 }; 170 }; 171}