warning: the following units failed: foo.mount
● foo.mount - /foo
Loaded: loaded (/etc/fstab; generated)
Active: failed (Result: exit-code) since Mon 2020-03-16 18:49:27 UTC; 34ms ago
Where: /foo
What: foo
Docs: man:fstab(5)
man:systemd-fstab-generator(8)
IP: 0B in, 0B out
CPU: 4ms
systemd[1]: Mounting /foo...
mount[11343]: /bin/sh: s3fs: command not found
systemd[1]: foo.mount: Mount process exited, code=exited, status=127/n/a
systemd[1]: foo.mount: Failed with result 'exit-code'.
systemd[1]: Failed to mount /foo.
Note that I added s3fs to the default environment using:
environment.systemPackages = [
pkgs.s3fs
];
and manually calling s3fs to mount the bucket works.
Anyone got any pointers on how to let mount/fuse find the s3fs binary?
Thanks for the reply. I finally solved this by creating a systemd service as well.
However, I believe that it should be made possible to have it work via the fileSystems service. I am not sure if this is a ‘bug’ in the nixos module or if I am just missing some configuration parameter.
I thought I would reply anyway after 10 months with my solution, because I found this thread by google.
As far as I could tell, there is no configuration parameter to set the execution path. You might be able to set the fsType to be an absolute path to the fuse program, not sure though. The fileSystems options translate directly to /etc/fstab, which is picked up by systemd. There is a configuration option systemd.services.<name>.path but no systemd.mounts.<name>.path.
The might be a case for adding the path option to mounts and fileSystems, in order to support fuse filesystems, or alternatively, for a special nixos module to handle fuse filesystems.
Great! I can confirm that this works. The device value needs to be the bucket name, and in our case we wanted to mount a subpath of the bucket which is possible with device = "bucket:/mypath".
I do find it strange that using fuse.${pkgs.s3fs}/bin/s3fs doesn’t work (as also observed in this comment)