flakes/modules/user/eww.nix

30 lines
1 KiB
Nix
Raw Normal View History

2025-03-23 12:44:10 +11:00
{ config, lib, pkgs, ... }:
let
2025-03-23 13:29:25 +11:00
inherit (lib) boolToString defaultTo;
res = pkgs.stdenvNoCC.mkDerivation {
pname = "eww-wayland-config";
version = "1.0.0";
dontUnpack = true;
installPhase = ''
2025-03-23 00:32:41 +11:00
cp -r ${../../res/eww} $out
substituteInPlace $out/eww.yuck \
2025-03-23 12:44:10 +11:00
--replace-fail "_BAT_ENABLED_" "${boolToString (config.me.batteryDevice != null)}" \
2025-03-23 13:29:25 +11:00
--replace-fail "_BAT_PATH_" "${defaultTo "" config.me.batteryDevice}" \
2025-03-23 12:44:10 +11:00
--replace-fail "_BT_ENABLED_" "${boolToString config.me.hasBluetooth}" \
--replace-fail "_WIFI_ENABLED_" "${boolToString config.me.hasWifi}"
substituteInPlace $out/eww.scss \
--replace-fail "EWW_BACKGROUND" "${config.catppuccin.hexcolors.crust}" \
--replace-fail "EWW_TEXT" "${config.catppuccin.hexcolors.text}" \
--replace-fail "EWW_ACCENT" "${config.catppuccin.hexcolors.${config.catppuccin.accent}}"
'';
};
in {
home.packages = with pkgs; [ iw socat ];
2024-01-17 15:33:46 +07:00
programs.eww = {
enable = true;
};
xdg.configFile."eww".source = res;
2024-01-17 15:33:46 +07:00
}