Hi Bjørn,

I remember struggling with this too. The following works for me:

fileSystems."/target" =
  fsType = "fuse";
  device = "${pkgs.sshfsFuse}/bin/sshfs#user@host:/path";
  options = [
    "noauto" "comment=systemd.automount"


  sshAsUser = user:
    writeScript "ssh_as_${user}" ''
      exec ${pkgs.sudo}/bin/sudo -i -u ${user} \
        ${pkgs.openssh}/bin/ssh $@

The "sshAsUser" command makes systemd use my gpg-agent session correctly when auto-mounting. But I guess you could use it to set any ssh options you'd like.

  / Rickard

On 09/18/2016 06:10 PM, Bjørn Forsman wrote:
Hi all,

I cannot get systemd to find the 'sshfs' binary needed to make this
configuration work:

  systemd.mounts = [
    { what = "bfo@whitetip.local:/";
      where = "/home/bfo/mnt/whitetip.local";
      type = "fuse.sshfs";
      options =
      unitConfig.Environment = "PATH=${pkgs.sshfsFuse}/bin";

The result is "/bin/sh: sshfs: command not found", as can be seen
below my signature.

Any suggestions?

nix-dev mailing list

Reply via email to