niksos/modules/gui/hypr/idle.nix

35 lines
921 B
Nix
Raw Normal View History

2024-06-09 15:54:49 +02:00
{
config,
inputs,
lib,
pkgs,
...
}: let
cfg = config.myOptions.programs.hypr.idle;
hmCfg = config.home-manager.users.${username};
inherit (config.myOptions.other.system) username;
inherit (lib) getExe' mkEnableOption mkIf;
loginctl = getExe' pkgs.systemd "loginctl";
2024-06-09 15:54:49 +02:00
in {
options.myOptions.programs.hypr.idle = {
enable = mkEnableOption "hiper bezczynny";
};
config = mkIf cfg.enable {
home-manager.users.${username} = {
services.hypridle = {
enable = true;
package = inputs.hypridle.packages.${pkgs.system}.hypridle;
settings = {
general = {
lock_cmd = lib.getExe hmCfg.programs.hyprlock.package;
before_sleep_cmd = "${loginctl} lock-session";
2024-06-09 15:54:49 +02:00
};
};
};
};
};
}