[Nix-dev] Automount for usb thumb drives / other external drives

Guillaume Maudoux (Layus) layus.on at gmail.com
Thu Jul 16 15:04:26 CEST 2015


Hi,

Le 16/07/15 13:58, Eelco Dolstra a écrit :
> Hi,
>
> On 15/07/15 23:22, Paul Koerbitz wrote:
>
>> I would like to automatically mount usb sticks that I plug into my
>> laptop. I haven't been able to figure out how to do this in NixOS,
>> what's the easiest option?
> The standard mechanism used for dealing with removable media is udisks, used by
> desktop environments like KDE and Xfce to allow non-root users to mount disks.
> It can also be used from the command-line, e.g.
>
>    $ udisksctl mount -b /dev/sdb1
>    Mounted /dev/sdb1 at /run/media/eelco/USBSTICK.
>
> Udisks doesn't mount disks automatically on insertion, but this could be done by
> having a script that listens for the D-Bus messages sent by udisks and then asks
> udisks to do the mount. In fact, there already is a package that does this:
>
>    https://github.com/fernandotcl/udisks-glue
>
> but it's not in Nixpkgs yet.
>
There is also the excellent udevil[1] tool that comes with devmon,
a monitoring and automonting daemon.
But udevil is not yet in nixpkgs either.

[1] http://ignorantguru.github.io/udevil/


More information about the nix-dev mailing list