Have made in excess of 20 attempts change this default mount point for all volumes in NIX 25.05 and no configuration.nix changes have been effective.
Is there a simple udev rule or udisks2 configuration to allow volumes clicked within the caja file manager to automatically mount under /media/volume_name rather than /run/media/$USER/volume_name?
I have used other versions of linux with a simple file creation such as:
udev rule sets env variable UDISKS_FILESYSTEM_SHARED. udisks2 automounts in /media/ not /media/[username]/
create file /etc/udev/rules.d/99-udisks2.rules containing:
ENV{ID_FS_USAGE}==âfilesystem|other|cryptoâ, ENV{UDISKS_FILESYSTEM_SHARED}=â1â include crypto
ENV{ID_FS_USAGE}==âfilesystemâ, ENV{UDISKS_FILESYSTEM_SHARED}=â1â no crypto
reload: sudo udevadm control --reload
Is there a similar fix for NixOS that would override the /run/media/$USER/volume_name to mount as /media/volume_name?
When enabled, instructs udisks2 to mount removable drives under /media/ directory, instead of the default, ACL-controlled /run/media/$USER/. Since /media/ is not mounted as tmpfs by default, it requires cleanup to get rid of stale mountpoints; enabling this option will take care of this at boot.
After rebuild and cleanup with nix-collect-garbage -d, nix-collect-garbage, and nix-store --optimize, partitions mounted to /media/volume_name,
after reboot revert to /run/media/$USER/volume_name
Do you also have services.udisks2.enabled = true; and have you ran nixos-rebuild switch after the change?
What youâre describing doesnât sound normal. Is your configuration properly importing your udisks2 module file, and are you defining anything about udisks2 anywhere else in your configuration?
Rebuild and cleanup without error, before reboot, clicking partitions in Caja file manager mount to /media/volume_name, after reboot revert to /run/media/$USER/volume_name.
I did initially rebuild with this line not commented out and the result was the same, so I put it in the module so it would not appear twice, once in configuration.nix and again in the module. Rebuild has complained in the past regard to things listed twice.
Would you mind sharing your whole configuration? Be it on GitHub/GitLab/Codeberg or whatever. Thereâs no way to tell whatâs going on from what youâve said here.
Sounds like youâve got yourself in a situation where the boot loader entry isnât updating, but the nixos-rebuild command canât tell that thatâs failing.
Youâve likely got a very broken configuration - assuming youâre running the correct commands - itâd definitely be a good idea to have someone look over it for you.
Did you switch bootloaders recently? If so you may need to delete any traces of the old bootloader, then use the --install-bootloader flag the next time you rebuild your config. If youâre using EFI boot, you can use efibootmgr to manage the firmware boot entries as well - ensure the NixOS-managed entry comes first.
You donât need this here. Have you created the file with that file structure, and also why? Youâve defined the proper udisks2 properties near the bottom of your configuration. I would delete these lines.
What bootloader are you using overall and how is it configured? I have no idea how this currently works for you and now NixOS generates the entry.
Is this hardcoded by you, or itâs just an example that youâve pasted here?
There are many more weird definitions in your config, but letâs start by resolving your main question.
Nixos boot file and kernel update issues are resolved. After updating Nixos it is a simple matter to copy the relevant GRUB2 menuentry information from Nixos to revise the active grub configuration file. The actual grub installation used for multibooting is on a separate partition of another linux distribution.
Additionally, apparently there was a problem with updating to 25.11 from 25.05 which involved updating profiles.
It appeared that the command âsudo nix-channel --update nixos; nixos-rebuild switchâ needed to be exectuted from a superuser prompt or permission was denied to create the symlink.
The upgrade to 25.11 resolved the mount issue and now volumes mount at /media/wolume_name as intended.
Again, thanks to all who responded to the inquiry.