60 lines
1.9 KiB
Nix
60 lines
1.9 KiB
Nix
# --- This file has been auto-generated. For permanent changes alter the appropriate block in the README.org. ---
|
|
{ lib, config, pkgs, flakeRoot, ... }:
|
|
let
|
|
# Use the config option defaultUser directly, fallback to "henrov"
|
|
username = config.defaultUser or "henrov";
|
|
basePath = "${flakeRoot}/generated/.config";
|
|
assetPath = "${flakeRoot}/generated/.config/waybar";
|
|
in
|
|
{
|
|
# Install Waybar system-wide
|
|
environment.systemPackages = [ pkgs.waybar ];
|
|
|
|
home-manager.users = {
|
|
${username} = {
|
|
home.file = {
|
|
".config/waybar/config" = {
|
|
text = builtins.readFile "${assetPath}/config";
|
|
force = true;
|
|
};
|
|
".config/waybar/style-dark.css" = {
|
|
text = builtins.replaceStrings ["henrov"] [username] (builtins.readFile "${assetPath}/style-dark.css");
|
|
force = true;
|
|
};
|
|
".config/scripts/bluetooth-status.sh" = {
|
|
text = builtins.readFile "${basePath}/scripts/bluetooth-status.sh";
|
|
force = true;
|
|
executable = true;
|
|
};
|
|
".config/scripts/hypr-workspaces.sh" = {
|
|
text = builtins.readFile "${basePath}/scripts/hypr-workspaces.sh";
|
|
force = true;
|
|
executable = true;
|
|
};
|
|
".config/scripts/hypr-workspacesmenu.sh" = {
|
|
text = builtins.readFile "${basePath}/scripts/hypr-workspacesmenu.sh";
|
|
force = true;
|
|
executable = true;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
# Systemd user service for Waybar
|
|
systemd.user.services.waybar = {
|
|
description = "Waybar for Hyprland";
|
|
after = [ "graphical-session.target" ];
|
|
|
|
serviceConfig = {
|
|
ExecStart = "${pkgs.waybar}/bin/waybar";
|
|
Restart = "always";
|
|
Environment = ''
|
|
WAYLAND_DISPLAY=${config.environment.sessionVariables.WAYLAND_DISPLAY or "wayland-0"}
|
|
XDG_CURRENT_DESKTOP=Hyprland
|
|
'';
|
|
};
|
|
|
|
wantedBy = [ "default.target" ];
|
|
};
|
|
}
|