Files
nixos/Droidnix/generated/modules/traveldroid/desktop/waybar.nix
T
2026-03-25 21:02:41 +00:00

33 lines
876 B
Nix

{ config, pkgs, ... }:
let
waybarPath = "${pkgs.waybar}/bin/waybar";
# Pick the first non-system user automatically
myUser = builtins.head (builtins.filter (u: config.users.users.${u}.isNormalUser != false) (builtins.attrNames config.users.users));
in
{
# Install Waybar in the system
environment.systemPackages = [
pkgs.waybar
];
# User systemd service for Waybar
systemd.user.services.waybar = {
description = "Waybar for Hyprland";
after = [ "graphical-session.target" ];
serviceConfig = {
ExecStart = "${waybarPath}";
Restart = "always";
Environment = ''
WAYLAND_DISPLAY=${config.environment.sessionVariables.WAYLAND_DISPLAY or "wayland-0"}
XDG_CURRENT_DESKTOP=Hyprland
XDG_RUNTIME_DIR=/run/user/${config.users.users.${myUser}.uid}
'';
};
wantedBy = [ "default.target" ];
};
}