feat: refactor home-manager configuration for multi-host support

This commit is contained in:
lightly-toasted 2025-08-31 22:16:33 +09:00
parent f20c875a48
commit 6d1fd47bea
47 changed files with 51 additions and 14 deletions

View file

@ -0,0 +1,31 @@
{ pkgs, actions }:
let
script = pkgs.writeShellScriptBin "run-mouse-action" ''
STATE_FILE="$HOME/.config/mouse-actions/state"
if [ ! -f "$STATE_FILE" ]; then
exit 0
fi
ACTION_NAME=$(<"$STATE_FILE")
case "$ACTION_NAME" in
"deafen")
systemd-run --user ${actions.deafen.package}/bin/deafen-action
;;
"sober-lag")
systemd-run --user ${actions.sober-lag.package}/bin/sober-lag-action
;;
"autoclick")
systemd-run --user ${actions.autoclick.package}/bin/autoclick-action
;;
esac
'';
in
{
package = pkgs.symlinkJoin {
name = "run-mouse-action";
paths = [ script pkgs.systemd ];
};
}