refactor(nix): apply executable helper rules

This commit was merged in pull request #163.
This commit is contained in:
2026-10-11 17:38:15 -04:00
parent 337d9a2014
commit d1face10ec
3 changed files with 12 additions and 12 deletions

View File

@@ -16,7 +16,7 @@ in
keys = "SUPER + Return"; keys = "SUPER + Return";
action = { action = {
kind = "exec"; kind = "exec";
command = "${pkgs.ghostty}/bin/ghostty"; command = lib.getExe pkgs.ghostty;
}; };
}; };

View File

@@ -21,10 +21,10 @@
general = { general = {
# The guard drops the call when a locker is already up, so no idle # The guard drops the call when a locker is already up, so no idle
# trigger stacks a second hyprlock over the first. # trigger stacks a second hyprlock over the first.
lock_cmd = "${pkgs.procps}/bin/pidof hyprlock || ${pkgs.hyprlock}/bin/hyprlock"; lock_cmd = "${lib.getExe' pkgs.procps "pidof"} hyprlock || ${lib.getExe pkgs.hyprlock}";
before_sleep_cmd = "loginctl lock-session"; before_sleep_cmd = "loginctl lock-session";
# Waking pokes the compositor in case firmware leaves displays dark. # Waking pokes the compositor in case firmware leaves displays dark.
after_sleep_cmd = "${config.programs.hyprland.package}/bin/hyprctl dispatch 'hl.dsp.dpms({ action = \"enable\" })'"; after_sleep_cmd = "${lib.getExe' config.programs.hyprland.package "hyprctl"} dispatch 'hl.dsp.dpms({ action = \"enable\" })'";
}; };
listener = [ listener = [

View File

@@ -13,28 +13,28 @@ let
unit=lockscreen-idle-inhibit.service unit=lockscreen-idle-inhibit.service
refresh_waybar() { refresh_waybar() {
${pkgs.procps}/bin/pkill -RTMIN+9 waybar >/dev/null 2>&1 || true ${lib.getExe' pkgs.procps "pkill"} -RTMIN+9 waybar >/dev/null 2>&1 || true
} }
if ${pkgs.systemd}/bin/systemctl --user is-active --quiet "$unit"; then if ${lib.getExe' pkgs.systemd "systemctl"} --user is-active --quiet "$unit"; then
${pkgs.systemd}/bin/systemctl --user stop "$unit" ${lib.getExe' pkgs.systemd "systemctl"} --user stop "$unit"
refresh_waybar refresh_waybar
${pkgs.swayosd}/bin/swayosd-client --custom-message "${sleepIcon}" ${lib.getExe' pkgs.swayosd "swayosd-client"} --custom-message "${sleepIcon}"
exit 0 exit 0
fi fi
if ${pkgs.systemd}/bin/systemd-run \ if ${lib.getExe' pkgs.systemd "systemd-run"} \
--user \ --user \
--collect \ --collect \
--unit=lockscreen-idle-inhibit \ --unit=lockscreen-idle-inhibit \
--description="Disable idle-triggered screen locking" \ --description="Disable idle-triggered screen locking" \
${pkgs.systemd}/bin/systemd-inhibit \ ${lib.getExe' pkgs.systemd "systemd-inhibit"} \
--what=idle \ --what=idle \
--who=lockscreen-hotkey \ --who=lockscreen-hotkey \
--why="lock screen disabled by hotkey" \ --why="lock screen disabled by hotkey" \
${pkgs.coreutils}/bin/sleep infinity >/dev/null; then ${lib.getExe' pkgs.coreutils "sleep"} infinity >/dev/null; then
refresh_waybar refresh_waybar
${pkgs.swayosd}/bin/swayosd-client --custom-message "${sleepOffIcon}" ${lib.getExe' pkgs.swayosd "swayosd-client"} --custom-message "${sleepOffIcon}"
fi fi
''; '';
in in
@@ -85,7 +85,7 @@ in
kind = "exec"; kind = "exec";
# The guard drops the call when a locker is already up, so no manual # The guard drops the call when a locker is already up, so no manual
# trigger stacks a second hyprlock over the first. # trigger stacks a second hyprlock over the first.
command = "${pkgs.procps}/bin/pidof hyprlock || ${pkgs.hyprlock}/bin/hyprlock"; command = "${lib.getExe' pkgs.procps "pidof"} hyprlock || ${lib.getExe pkgs.hyprlock}";
}; };
}; };