36 lines
972 B
Nix
36 lines
972 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.stdenv.system}.hypridle;
|
|
settings = {
|
|
general = {
|
|
lock_cmd = getExe hmCfg.programs.hyprlock.package;
|
|
before_sleep_cmd = "${loginctl} lock-session";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|