mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-09-14 22:01:46 +02:00
Replace the static hypridle.conf with services.hypridle.settings and add required timeout options so each host tunes its own values: - idols-ai (PC): 15 min keyboard, 20 min screen-off, 30 min lock. - 12kingdoms-shoukei (laptop): 3 / 6 / 20 min (previous values). The options have no defaults because the right values depend on the machine. Update the home-manager eval test to inspect the settings option instead of the old config file text.
28 lines
789 B
Nix
28 lines
789 B
Nix
{
|
|
myvars,
|
|
lib,
|
|
outputs,
|
|
}:
|
|
let
|
|
username = myvars.username;
|
|
hosts = [
|
|
"shoukei-niri"
|
|
];
|
|
in
|
|
lib.genAttrs hosts (
|
|
name:
|
|
let
|
|
hm = outputs.nixosConfigurations.${name}.config.home-manager.users.${username};
|
|
listeners = hm.services.hypridle.settings.listener;
|
|
findByAction = action: lib.findFirst (l: (l."on-timeout" or "") == action) { } listeners;
|
|
screenOff = findByAction "niri msg action power-off-monitors";
|
|
lock = findByAction "noctalia-shell ipc call lockScreen lock";
|
|
in
|
|
{
|
|
homeDirectory = hm.home.homeDirectory;
|
|
hypridleScreenOffIgnoresInhibitors = screenOff.ignore_inhibit or false;
|
|
hypridleScreenOffSkipsPlayingMedia = (screenOff.condition_cmd or "") != "";
|
|
hypridleLockIgnoresInhibitors = lock.ignore_inhibit or false;
|
|
}
|
|
)
|