aboutsummaryrefslogtreecommitdiff
path: root/modules/hosts/desktop/waybar.nix
diff options
context:
space:
mode:
authorLeander Scherer <leander@schererleander.de>2026-01-08 02:48:11 +0100
committerLeander Scherer <leander@schererleander.de>2026-01-08 19:08:12 +0100
commit6174f3650cf42aaf008012e828d5a1f8e2ce037f (patch)
tree9bbbd99680cd5adb56596a14734d4896bc6af733 /modules/hosts/desktop/waybar.nix
parentc582c4d0675aada46fa196b7af1941ed753d055f (diff)
refactor(modules): separate nixos/home-manager modules, use standard option conventions
Diffstat (limited to 'modules/hosts/desktop/waybar.nix')
-rw-r--r--modules/hosts/desktop/waybar.nix134
1 files changed, 134 insertions, 0 deletions
diff --git a/modules/hosts/desktop/waybar.nix b/modules/hosts/desktop/waybar.nix
new file mode 100644
index 0000000..23b0f59
--- /dev/null
+++ b/modules/hosts/desktop/waybar.nix
@@ -0,0 +1,134 @@
+{
+ config,
+ lib,
+ username,
+ ...
+}:
+
+let
+ inherit (lib) mkEnableOption mkIf;
+ cfg = config.nx.desktop.waybar;
+in
+{
+ options.nx.desktop.waybar.enable = mkEnableOption "Enable and configure Waybar";
+ config = mkIf cfg.enable {
+ home-manager.users."${username}" = {
+ programs.waybar = {
+ enable = true;
+ settings = {
+ mainBar = {
+ height = 32;
+ layer = "top";
+ position = "bottom";
+ modules-center = [ "mpris" ];
+ modules-left = [ "sway/workspaces" ];
+ modules-right = [
+ "privacy"
+ "tray"
+ "battery"
+ "pulseaudio"
+ "network"
+ "bluetooth"
+ "clock"
+ ];
+
+ mpris = {
+ format = "{title}";
+ tooltip-format = "{artist} - {album}";
+ };
+
+ tray = {
+ spacing = 10;
+ };
+
+ privacy = {
+ icon-size = 16;
+ };
+
+ cpu = {
+ format = "󰻠";
+ tooltip = true;
+ };
+
+ memory = {
+ format = "";
+ };
+
+ temperature = {
+ critical-threshold = 80;
+ format = "";
+ };
+
+ network = {
+ format-disconnect = "󰌙";
+ format-ethernet = "󰌘";
+ format-wifi = "{icon}";
+ format-icons = [
+ "󰤟"
+ "󰤢"
+ "󰤥"
+ "󰤨"
+ ];
+
+ tooltip-format-wifi = "{essid} | {signalStrength}%";
+ tooltip-format-ethernet = "{ifname}";
+ };
+
+ bluetooth = {
+ format = " {status}";
+ format-disabled = "";
+ format-no-controller = "";
+ format-connected = " {device_alias}";
+ tooltip = false;
+ };
+
+ clock = {
+ format-alt = "{:%Y-%m-%d}";
+ tooltip-format = "{:%Y-%m-%d | %H:%M}";
+ };
+
+ pulseaudio = {
+ format = "{icon}";
+ format-icons = {
+ default = [
+ ""
+ ""
+ ""
+ ];
+ };
+ tooltip-format = "{desc} | {volume}%";
+ };
+ };
+ };
+
+ style = ''
+ * {
+ border: none;
+ border-radius: 0;
+ font-family: monospace;
+ font-size: 12px;
+ background: none;
+ }
+
+ window#waybar {
+ background: rgba(0, 0, 0, 0.9);
+ }
+
+ #workspaces button {
+ padding-left: 5px;
+ padding-right: 5px;
+ }
+
+ #workspaces button.focused {
+ font-weight: bold;
+ }
+
+ #clock, #pulseaudio, #tray, #network, #battery, #bluetooth, #cpu, #memory, #temperature, #custom-expand, #group-expand {
+ padding-left: 10px;
+ padding-right: 10px;
+ }
+ '';
+ };
+ };
+ };
+}