Skip to content

Commit

Permalink
nixos/wayland: programs.hyprland.withUWSM = true
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagokokada committed Dec 28, 2024
1 parent 1ccc2df commit ad8a01f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
2 changes: 2 additions & 0 deletions modules/home-manager/desktop/wayland/hyprland/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ in

wayland.windowManager.hyprland = {
enable = true;
# Conflicts with programs.hyprland.withUWSM
systemd.enable = false;
settings =
let
inherit (config.home-manager.desktop.default) browser terminal fileManager;
Expand Down
11 changes: 7 additions & 4 deletions modules/home-manager/desktop/wayland/swayidle.nix
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,13 @@ in

# Add some time before restart, to avoid the following error:
# swayidle.service: Start request repeated too quickly.
systemd.user.services.swayidle.Service = {
# Use exponential restart
RestartSteps = 5;
RestartMaxDelaySec = 10;
systemd.user.services.swayidle = {
Unit.After = [ "graphical-session.target" ];
Service = {
# Use exponential restart
RestartSteps = 5;
RestartMaxDelaySec = 10;
};
};
};
}
7 changes: 5 additions & 2 deletions modules/home-manager/desktop/wayland/waybar.nix
Original file line number Diff line number Diff line change
Expand Up @@ -419,15 +419,18 @@ in
};

systemd.user.services.waybar = {
Unit.ConditionEnvironment = "WAYLAND_DISPLAY";
Unit = {
After = lib.mkForce [ "graphical-session.target" ];
ConditionEnvironment = "WAYLAND_DISPLAY";
};
Service = {
# Use exponential restart
# https://enotty.pipebreaker.pl/posts/2024/01/how-systemd-exponential-restart-delay-works/
RestartSec = "250ms";
RestartSteps = 5;
RestartMaxDelaySec = 5;
# https://github.com/nix-community/home-manager/issues/4099
Environment = "PATH=${config.home.profileDirectory}/bin";
Environment = [ "PATH=${config.home.profileDirectory}/bin:/run/current-system/sw/bin" ];
};
};
};
Expand Down
5 changes: 4 additions & 1 deletion modules/nixos/desktop/wayland.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@

config = lib.mkIf config.nixos.desktop.wayland.enable {
programs = {
hyprland.enable = true;
hyprland = {
enable = true;
withUWSM = true;
};
sway = {
# Make Sway available for display managers and make things like swaylock work
enable = true;
Expand Down

0 comments on commit ad8a01f

Please sign in to comment.