niksos/modules/gui/hypr/idle.nix
2024-06-09 15:54:49 +02:00

32 lines
881 B
Nix

{
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";
};
};
};
};
};
}