{...}: { home."main".modules = [ ({ pkgs, lib, ... }: let inherit (lib) getExe ; script = pkgs.writeShellScript "inputplug.sh" '' mkdir -p $HOME/.cache/inputplug EVENT_TYPE="$1" DEVICE_ID="$2" DEVICE_TYPE="$3" DEVICE_NAME="$4" ''; in { systemd.user.services."inputplug" = { Service = { Type = "simple"; ExecStart = ''${getExe pkgs.inputplug} -c ${script}''; }; }; }) ]; }