niksos/modules/gui/hypr/idle.nix
2024-08-06 17:46:57 +02:00

36 lines
965 B
Nix

{
config,
inputs,
lib,
pkgs,
...
}: let
cfg = config.poz.programs.hypr.idle;
hmCfg = config.home-manager.users.${username};
inherit (config.poz.other.system) username;
inherit (lib.meta) getExe getExe';
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption;
loginctl = getExe' pkgs.systemd "loginctl";
in {
options.poz.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 = getExe hmCfg.programs.hyprlock.package;
before_sleep_cmd = "${loginctl} lock-session";
};
};
};
};
};
}