Files
nix-config-ryan4yin/outputs/aarch64-linux/tests/home-manager/expr.nix
T
Ryan Yin 7131041107 feat(hypridle): define config in home-manager with per-host timeouts
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.
2026-09-13 23:45:42 +08:00

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;
}
)