-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nixos/hyprland: only run the service on Hyprland
This needs uwsm enabled. You can do so by setting `programs.hyprland.withUWSM = true`
- Loading branch information
1 parent
ebada93
commit a58ba43
Showing
1 changed file
with
19 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,17 +10,31 @@ let | |
in | ||
{ | ||
options.services.hypridle = { | ||
enable = lib.mkEnableOption "hypridle, Hyprland's idle daemon"; | ||
enable = lib.mkEnableOption null // { | ||
description = '' | ||
Whether to enable Hypridle, Hyprland's idle daemon. | ||
::: {.note} | ||
For this service to work properly on Hyprland, you | ||
need to have `programs.hyprland.withUWSM` enabled. | ||
::: | ||
''; | ||
}; | ||
package = lib.mkPackageOption pkgs "hypridle" { }; | ||
}; | ||
|
||
config = lib.mkIf cfg.enable { | ||
environment.systemPackages = [ cfg.package ]; | ||
|
||
systemd = { | ||
packages = [ cfg.package ]; | ||
user.services.hypridle.wantedBy = [ "graphical-session.target" ]; | ||
user.services.hypridle.path = [ | ||
systemd.packages = [ cfg.package ]; | ||
|
||
systemd.user.services.hypridle = { | ||
# Service should be only be started on Hyprland | ||
# this target is started by UWSM | ||
wantedBy = [ "[email protected]" ]; | ||
|
||
# Essential package needed for the service to run properly | ||
path = [ | ||
config.programs.hyprland.package | ||
config.programs.hyprlock.package | ||
pkgs.procps | ||
|