mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 21:19:45 +01:00
hypridle: configurable systemd target
This commit is contained in:
parent
8f6ca7855d
commit
e777fd4282
2 changed files with 19 additions and 2 deletions
|
@ -11,6 +11,20 @@ in {
|
|||
|
||||
package = mkPackageOption pkgs "hypridle" { };
|
||||
|
||||
systemd = {
|
||||
enable = lib.mkEnableOption "Hypridle Systemd integration" // {
|
||||
default = true;
|
||||
};
|
||||
target = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "graphical-session.target";
|
||||
example = "hyprland-session.target";
|
||||
description = ''
|
||||
The systemd target that will automatically start the hypridle service.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = with lib.types;
|
||||
let
|
||||
|
@ -73,8 +87,8 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
systemd.user.services.hypridle = {
|
||||
Install = { WantedBy = [ "graphical-session.target" ]; };
|
||||
systemd.user.services.hypridle = mkIf cfg.systemd.enable {
|
||||
Install = { WantedBy = [ cfg.systemd.target ]; };
|
||||
|
||||
Unit = {
|
||||
ConditionEnvironment = "WAYLAND_DISPLAY";
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
enable = true;
|
||||
package = pkgs.hypridle;
|
||||
|
||||
systemd.target = "hyprland-session.target";
|
||||
|
||||
settings = {
|
||||
general = {
|
||||
after_sleep_cmd = "hyprctl dispatch dpms on";
|
||||
|
@ -34,5 +36,6 @@
|
|||
assertFileExists $config
|
||||
assertFileExists $clientServiceFile
|
||||
assertFileContent $config ${./hypridle.conf}
|
||||
assertFileContains $clientServiceFile "WantedBy=hyprland-session.target"
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue