niksos/modules/gui/hypr/idle.nix

33 lines
881 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) mkEnableOption mkIf;
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 = "${pkgs.systemd}/bin/loginctl lock-session";
};
};
};
};
};
}