Files
nixy/home/system/waybar/default.nix
T
kptltd00m fe508d9cd8 Migrate Hyprland to Lua config, drop dead flake inputs, general cleanup
Hyprland
- Switch wayland.windowManager.hyprland to configType = "lua" (Hyprland 0.56)
- Convert settings, env, monitors, window rules, gesture, animations
  (hl.curve/hl.animation) and all keybinds to hl.* calls
- Add home/system/hyprland/lib.nix with exec/bind/execOnce helpers;
  every exec-once now runs from a hyprland.start hook
- Drop hard-coded default_monitor = "eDP-2"

Flake
- Remove blog, awesome-wallpapers and default-creds inputs (their repos
  no longer ship a flake.nix and broke `nix flake update`), along with
  the server modules and Glance links that used them
- Update flake.lock
- Replace removed `gcr` with `gcr_4`

Fixes
- Point configDirectory at /etc/nixos/nixy on home-pc and thinkpad
- Fix home-pc git email typo
- Remove conflicting openpgp signing format, make pull.rebase a boolean,
  replace hx/peco in git aliases with nvim/sk
- Fix zsh NUL alias (2>&1) and stop forcing bat colors in the cat alias
- Require a password for sudo again (nixos-rebuild stays NOPASSWD)
- Remove duplicate hardware.graphics block from home-pc flake
- Delete unused zen .old files, run alejandra on host files
2026-09-28 18:15:30 +02:00

275 lines
5.0 KiB
Nix

{ pkgs, config, lib, ... }:
let
colors = config.lib.stylix.colors;
rgb = base:
"${colors."${base}-rgb-r"}, ${colors."${base}-rgb-g"}, ${colors."${base}-rgb-b"}";
terminal = cmd: "uwsm app -- ${lib.getExe pkgs.ghostty} -e ${cmd}";
radius = toString config.theme.bar-rounding;
hl = import ../hyprland/lib.nix {inherit lib;};
in
{
home.packages = with pkgs; [
waybar
];
xdg.configFile."waybar/config".text = builtins.toJSON {
layer = "top";
position = "top";
height = 38;
spacing = 10;
"margin-top" = 8;
"margin-left" = 8;
"margin-right" = 8;
"gtk-layer-shell" = true;
"reload_style_on_change" = true;
"modules-left" = [
"hyprland/workspaces"
"tray"
];
"modules-center" = [
"hyprland/window"
];
"modules-right" = [
"custom/bluetooth"
"network"
"battery"
"pulseaudio"
"clock"
];
"hyprland/workspaces" = {
format = "{name}";
"disable-scroll" = true;
"all-outputs" = true;
"on-click" = "activate";
"persistent-workspaces" = {
"*" = 5;
};
};
"hyprland/window" = {
format = "{}";
"max-length" = 70;
"separate-outputs" = true;
};
tray = {
spacing = 8;
"icon-size" = 20;
};
network = {
interval = 2;
"format-wifi" = "󰖩 {signalStrength}%";
"format-ethernet" = "󰈀 {ifname}";
"format-linked" = "󰈀 {ifname}";
"format-disconnected" = "󰖪";
"tooltip-format" = "{essid}\n{ipaddr}";
"on-click" = terminal "wifitui";
};
battery = {
interval = 30;
states = {
warning = 30;
critical = 15;
};
format = "󰁹 {capacity}%";
"format-charging" = "󰂄 {capacity}%";
"format-plugged" = "󰂄 {capacity}%";
"format-full" = "󰁹 {capacity}%";
"tooltip-format" = "Battery {capacity}%\n{timeTo} remaining";
};
"custom/bluetooth" = {
exec = "echo 󰂯";
interval = 3600;
tooltip = false;
"on-click" = "uwsm app -- blueman-manager";
};
pulseaudio = {
"scroll-step" = 5;
format = "󰕾 {volume}%";
"format-muted" = "󰖁";
tooltip = true;
"on-click" = terminal "wiremix";
};
clock = {
interval = 1;
format = "󰥔 {:%H:%M}";
"tooltip-format" = "<big>{:%A, %d %B %Y}</big>";
};
};
xdg.configFile."waybar/style.css".text = ''
* {
border: none;
min-height: 0;
font-family:
"${config.stylix.fonts.sansSerif.name}",
"${config.stylix.fonts.monospace.name}",
sans-serif;
font-size: 13px;
}
window#waybar {
background: transparent;
color: #${colors.base05};
}
.modules-left,
.modules-center,
.modules-right {
margin: 6px 0;
}
#workspaces,
#window,
#tray,
#custom-bluetooth,
#network,
#battery,
#pulseaudio,
#clock {
background: rgba(${rgb "base01"}, 0.76);
border: 1px solid rgba(${rgb "base03"}, 0.45);
border-radius: ${radius}px;
padding: 0 14px;
margin: 6px 4px;
transition:
background-color 180ms ease,
border-color 180ms ease,
color 180ms ease;
}
#workspaces {
padding: 4px;
}
#workspaces button {
background: transparent;
color: #${colors.base04};
padding: 0 12px;
margin: 0 2px;
border-radius: ${radius}px;
transition: all 180ms ease;
}
#workspaces button:hover {
background: rgba(${rgb "base02"}, 0.70);
color: #${colors.base05};
}
#workspaces button.active {
background: #${colors.base0D};
color: #${colors.base00};
}
#workspaces button.urgent {
background: #${colors.base08};
color: #${colors.base00};
}
#window {
min-width: 260px;
padding-left: 18px;
padding-right: 18px;
color: #${colors.base05};
}
#window.empty {
background: transparent;
border: none;
}
#tray {
padding-left: 10px;
padding-right: 10px;
}
#custom-bluetooth {
color: #${colors.base0E};
}
#network {
color: #${colors.base0C};
}
#network.disconnected {
color: #${colors.base08};
}
#battery {
color: #${colors.base0A};
}
#battery.charging,
#battery.plugged {
color: #${colors.base0B};
}
#battery.warning {
color: #${colors.base0A};
}
#battery.critical {
color: #${colors.base08};
}
#pulseaudio {
color: #${colors.base0B};
}
#pulseaudio.muted {
color: #${colors.base08};
}
#clock {
color: #${colors.base0D};
font-weight: 600;
}
tooltip {
background: rgba(${rgb "base00"}, 0.90);
border: 1px solid rgba(${rgb "base03"}, 0.70);
border-radius: ${radius}px;
}
tooltip label {
color: #${colors.base05};
}
'';
wayland.windowManager.hyprland.settings.on = hl.execOnce ["waybar"];
}