Jump to content

USB storage devices

From NixOS Wiki

Auto-mounting with udisks

udiskie, a udisks2 front-end that allows to manage removable media can be used. To enable automounting, first enable udisks2:

/etc/nixos/configuration.nix
services.udisks2.enable = true;

Next enable udiskie via Home Manager:

~/.config/home-manager/home.nix
services.udiskie = {
    enable = true;
    settings = {
        # workaround for
        # https://github.com/nix-community/home-manager/issues/632
        program_options = {
            # replace with your favorite file manager
            file_manager = "${pkgs.nemo-with-extensions}/bin/nemo";
        };
    };
};

Once the configurations are reflected, USB storage devices will be instantly recognized when inserted without any additional operations needed.

For other solutions, please refer to udisks - ArchWiki or USB storage devices - ArchWiki.