{ final, prev, ... }: {
  sshpassSecret = prev.writeScriptBin "sshpass-secret" ''
    #!${final.zsh}/bin/zsh -e

    typeset -a cmd
    cmd=()

    while
      if [[ "$#" -le 0 ]]; then
        echo "Insufficient arguments" >&2
        exit 2
      fi
      arg="''${1}"
      shift
    do
      [[ "''${arg}" == '--' ]] && break
      user=''${arg%@*}
      host=''${arg#*@}
      exec {fdnum}<<<$(${final.libsecret}/bin/secret-tool lookup service sshpass host "''${host}" user "''${user}")
      cmd+=(${final.sshpass}/bin/sshpass -d ''${fdnum} -P "''${user}@''${host}'s password:")
    done

    cmd+=($@)
    exec -a ''${cmd[1]} -- $cmd
  '';
}