{ lib, config, pkgs, ... }:
let
name = "clock";
in
{
options.modules.waybar.modules = import ./addname.nix lib name;
options.modules.waybar.enabled.${name} = {
enable = lib.mkEnableOption "enable ${name} waybar module";
};
config = lib.mkIf config.modules.waybar.enabled.${name}.enable {
programs.waybar = {
settings.mainBar.${name} = {
tooltip-format = "{:%Y %B}\n\n{calendar}";
interval = 1;
format = "{:%H:%M:%S}";
format-alt = "{:%Y-%m-%d %H:%M:%S}";
on-click-middle = "gnome-clocks";
calendar = {
weeks-pos = "left";
format = {
today = "{}"; # TODO: use nix-colors
weeks = "{}"; # TODO: use nix-colors
};
};
home.packages = [
pkgs.gnome-clocks
];
};
style = ''
#clock {
color: #${config.colorScheme.palette.taskbarText};
margin: 0px 2px;
padding: 0 15px;
border-radius: 999px;
box-shadow: none;
}
'';
};
};
}