diff --git a/home/common/programs/desktop/default.nix b/home/common/programs/desktop/default.nix index 9186afe..fb9d7fb 100644 --- a/home/common/programs/desktop/default.nix +++ b/home/common/programs/desktop/default.nix @@ -6,6 +6,7 @@ { imports = [ ./darkman.nix + ./udiskie.nix # mpv is installed by programs.mpv there, not as a bare package here. ../mpv.nix ]; diff --git a/home/common/programs/desktop/udiskie.nix b/home/common/programs/desktop/udiskie.nix new file mode 100644 index 0000000..ecf6471 --- /dev/null +++ b/home/common/programs/desktop/udiskie.nix @@ -0,0 +1,13 @@ +{ ... }: +{ + # Mounts removable media on insert. Needed on top of host-side udisks2: + # udisks2 only exposes the API, and Thunar is installed as a bare package + # here (no thunar-volman), so nothing would otherwise mount anything. + services.udiskie = { + enable = true; + automount = true; + notify = true; + # No systray dependency — unmount from Thunar or `udisksctl unmount`. + tray = "never"; + }; +} diff --git a/hosts/arrakis/default.nix b/hosts/arrakis/default.nix index 3ffb213..ba40ddc 100644 --- a/hosts/arrakis/default.nix +++ b/hosts/arrakis/default.nix @@ -24,6 +24,7 @@ ../common/features/smb-mounts.nix ../common/features/transmission.nix ../common/features/ydotool.nix + ../common/features/udisks.nix ../common/features/home ]; diff --git a/hosts/common/features/udisks.nix b/hosts/common/features/udisks.nix new file mode 100644 index 0000000..7cc58d2 --- /dev/null +++ b/hosts/common/features/udisks.nix @@ -0,0 +1,9 @@ +{ ... }: +{ + # Removable media. udisks2 provides the D-Bus API plus the polkit rules that + # let the logged-in user mount without root — which is what makes flashing a + # keyboard possible, since there's no keyboard to type a sudo password with. + services.udisks2.enable = true; + # gvfs is what lets Thunar list and unmount the device. + services.gvfs.enable = true; +} diff --git a/hosts/konishi/default.nix b/hosts/konishi/default.nix index bcf97bc..d28d52a 100644 --- a/hosts/konishi/default.nix +++ b/hosts/konishi/default.nix @@ -24,6 +24,7 @@ ../common/features/smb-mounts.nix ../common/features/transmission.nix ../common/features/ydotool.nix + ../common/features/udisks.nix ../common/features/home ];