dot

NixOS dotfiles
git clone https://git.echoz.io/dot.git
Log | Files | Refs

commit bc86f2f686dff561c204da83507fc35da416aabd
parent c40bde9807b21a60a3388b3352bfdebc446aaec0
Author: Chris <chris@echoz.io>
Date:   Thu, 25 Jun 2026 04:27:20 +0200

fix(eww): use home-manager yuck and scss config options

Diffstat:
Mmodules/eww/default.nix | 101+++++++++++++++++++++++++++++++++++--------------------------------------------
1 file changed, 45 insertions(+), 56 deletions(-)

diff --git a/modules/eww/default.nix b/modules/eww/default.nix @@ -7,60 +7,6 @@ ... }: let - yuck = pkgs.writeTextDir "/eww.yuck" '' - (defwidget microphone-indicator [] - (box - :orientation "v" - :halign "center" - :valign "center" - :visible {!microphone-muted} - :active "false" - (label :xalign 0.5 :justify "center" :text ""))) - - (defwindow microphone-indicator - :monitor 0 - :stacking "overlay" - :focusable "none" - :namespace "microphone-indicator" - :geometry (geometry :y "10px" :width "0px" :height "0px" :anchor "top center") - (microphone-indicator)) - - (deflisten microphone-muted - :initial "false" - "${pkgs.writeShellScript "monitor-microphone-muted" '' - ${lib.getExe pkgs.pamixer} --default-source --get-mute - ${lib.getExe' pkgs.pulseaudio "pactl"} --format json subscribe \ - | ${lib.getExe pkgs.jq} --unbuffered -cr 'select(.event == "change" and .on == "source") | "."' \ - | xargs -L1 ${lib.getExe pkgs.pamixer} --default-source --get-mute - ''}") - ''; - - scss = - let - s = toString; - fg = with style.colors.fg; "rgba(${s r},${s g},${s b},0.2)"; - in - pkgs.writeTextDir "/eww.scss" '' - .microphone-indicator { - color: ${fg}; - font-size: 32px; - min-width: 44px; - min-height: 44px; - - &.background { - background: ${style.colors.bg.rgba}; - border-radius: 10px; - } - } - ''; - - configDir = pkgs.symlinkJoin { - name = "eww-config"; - paths = [ - yuck - scss - ]; - }; in { home-manager.users.${user} = @@ -71,8 +17,52 @@ in ]; programs.eww = { - inherit configDir; enable = true; + yuckConfig = '' + (defwidget microphone-indicator [] + (box + :orientation "v" + :halign "center" + :valign "center" + :visible {!microphone-muted} + :active "false" + (label :xalign 0.5 :justify "center" :text ""))) + + (defwindow microphone-indicator + :monitor 0 + :stacking "overlay" + :focusable "none" + :namespace "microphone-indicator" + :geometry (geometry :y "10px" :width "0px" :height "0px" :anchor "top center") + (microphone-indicator)) + + (deflisten microphone-muted + :initial "false" + "${pkgs.writeShellScript "monitor-microphone-muted" '' + ${lib.getExe pkgs.pamixer} --default-source --get-mute + ${lib.getExe' pkgs.pulseaudio "pactl"} --format json subscribe \ + | ${lib.getExe pkgs.jq} --unbuffered -cr 'select(.event == "change" and .on == "source") | "."' \ + | xargs -L1 ${lib.getExe pkgs.pamixer} --default-source --get-mute + ''}") + ''; + scssConfig = + let + s = toString; + fg = with style.colors.fg; "rgba(${s r},${s g},${s b},0.2)"; + in + '' + .microphone-indicator { + color: ${fg}; + font-size: 32px; + min-width: 44px; + min-height: 44px; + + &.background { + background: ${style.colors.bg.rgba}; + border-radius: 10px; + } + } + ''; }; systemd.user.services.eww = { @@ -80,7 +70,6 @@ in PartOf = [ config.wayland.systemd.target ]; After = [ config.wayland.systemd.target ]; ConditionEnvironment = "WAYLAND_DISPLAY"; - X-Restart-Triggers = [ "${config.programs.eww.configDir}" ]; }; Service = {