From 9eb1eabfb13c3a88b0a6fd4832bd76c4ba5a1159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 13 Oct 2022 16:18:15 +0200 Subject: shellrc-desktop.d/ssh: fix for Nix --- shellrc-desktop.d/ssh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/shellrc-desktop.d/ssh b/shellrc-desktop.d/ssh index 7a1b71f..0de644e 100644 --- a/shellrc-desktop.d/ssh +++ b/shellrc-desktop.d/ssh @@ -10,9 +10,15 @@ sshcfs() { shift 3 [[ "$local_dir" = /* ]] || local_dir="$PWD/$local_dir" + local sftp_server="/usr/lib64/misc/sftp-server" + if [ -e /run/current-system/sw/bin/ssh ]; then + sftp_server="$(readlink -f /run/current-system/sw/bin/ssh)" + sftp_server="${sftp_server%/bin/ssh}/libexec/sftp-server" + fi + ssh "$@" "$target" mkdir -p "$remote_dir" dpipe \ - /usr/lib64/misc/sftp-server \ + "$sftp_server" \ = \ ssh "$@" "$target" sshfs -o idmap=user -o passive -o allow_other \ ":$local_dir" "$remote_dir" -- cgit v1.2.3