From 6174f3650cf42aaf008012e828d5a1f8e2ce037f Mon Sep 17 00:00:00 2001 From: Leander Scherer Date: Thu, 8 Jan 2026 02:48:11 +0100 Subject: refactor(modules): separate nixos/home-manager modules, use standard option conventions --- modules/hosts/desktop/waybar.nix | 134 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 modules/hosts/desktop/waybar.nix (limited to 'modules/hosts/desktop/waybar.nix') 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; + } + ''; + }; + }; + }; +} -- cgit v1.3.1