From ad8a01fc7ab9e0e19da0bfe8287e7381a727810c Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Sat, 28 Dec 2024 13:26:29 +0000 Subject: [PATCH] nixos/wayland: programs.hyprland.withUWSM = true --- .../home-manager/desktop/wayland/hyprland/default.nix | 2 ++ modules/home-manager/desktop/wayland/swayidle.nix | 11 +++++++---- modules/home-manager/desktop/wayland/waybar.nix | 7 +++++-- modules/nixos/desktop/wayland.nix | 5 ++++- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/modules/home-manager/desktop/wayland/hyprland/default.nix b/modules/home-manager/desktop/wayland/hyprland/default.nix index e24cbce0..35ea4da8 100644 --- a/modules/home-manager/desktop/wayland/hyprland/default.nix +++ b/modules/home-manager/desktop/wayland/hyprland/default.nix @@ -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; diff --git a/modules/home-manager/desktop/wayland/swayidle.nix b/modules/home-manager/desktop/wayland/swayidle.nix index 530539f4..f59f3d1e 100644 --- a/modules/home-manager/desktop/wayland/swayidle.nix +++ b/modules/home-manager/desktop/wayland/swayidle.nix @@ -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; + }; }; }; } diff --git a/modules/home-manager/desktop/wayland/waybar.nix b/modules/home-manager/desktop/wayland/waybar.nix index b6f88522..27389841 100644 --- a/modules/home-manager/desktop/wayland/waybar.nix +++ b/modules/home-manager/desktop/wayland/waybar.nix @@ -419,7 +419,10 @@ 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/ @@ -427,7 +430,7 @@ in 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" ]; }; }; }; diff --git a/modules/nixos/desktop/wayland.nix b/modules/nixos/desktop/wayland.nix index 0687b69c..ba591a95 100644 --- a/modules/nixos/desktop/wayland.nix +++ b/modules/nixos/desktop/wayland.nix @@ -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;