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"
    "ssh_command=${sshAsUser}"
  ];
};

where

  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 =
"_netdev,users,idmap=user,IdentityFile=/home/user/.ssh/id_rsa,allow_other,reconnect";
      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
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to