From ad459e2b4b4f6a25bc81c10606e7435c65c9d76f Mon Sep 17 00:00:00 2001 From: ahmza Date: Wed, 5 Aug 2026 22:05:49 +0100 Subject: [PATCH] enable udisks2 and run udiskie as a user unit udiskie was installed but never actually launched - nothing in the dotfiles autostarts it, and services.udisks2 was off, so even once started it had no daemon to talk to. binds it to graphical-session.target (managed by uwsm) so it starts and stops with the session. only touches removable media: udisks2 reports the internal sata disks as HintSystem=true, so the drives declared in disks.nix are left alone. --- modules/features/hyprland/default.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/modules/features/hyprland/default.nix b/modules/features/hyprland/default.nix index 8d83900..41c399c 100644 --- a/modules/features/hyprland/default.nix +++ b/modules/features/hyprland/default.nix @@ -27,6 +27,32 @@ services.xserver.enable = true; security.polkit.enable = true; + # Removable-media automounting. + # + # udiskie is only a tray frontend to the udisks2 D-Bus daemon, so the daemon + # has to be enabled or udiskie runs but can never mount anything. Note this + # covers removable media *only*: udisks2 reports the internal SATA disks as + # HintSystem=true, so udiskie leaves them alone. Permanently attached drives + # are declared in the host's disks.nix instead. + services.udisks2.enable = true; + + # Run udiskie as a user unit rather than from the hypr autostart — it was + # previously only installed, never actually launched. Binding it to + # graphical-session.target (which UWSM manages properly) means it starts and + # stops with the session instead of leaking across logins. + systemd.user.services.udiskie = { + description = "udiskie removable media automounter"; + partOf = ["graphical-session.target"]; + after = ["graphical-session.target"]; + wantedBy = ["graphical-session.target"]; + serviceConfig = { + Type = "simple"; + # -s = smart tray: the icon appears only while removable media is present. + ExecStart = "${pkgs.udiskie}/bin/udiskie -s"; + Restart = "on-failure"; + }; + }; + environment.systemPackages = with pkgs; [ # hypr* ecosystem (keybinds / hypridle / autostart) hyprlock