diff --git a/nixos/modules/hardware/yubikey/default.nix b/nixos/modules/hardware/yubikey/default.nix index 708b9c1..2134c87 100644 --- a/nixos/modules/hardware/yubikey/default.nix +++ b/nixos/modules/hardware/yubikey/default.nix @@ -25,11 +25,17 @@ in { ]; # Send a notification if the YubiKey is waiting for touch. - systemd.user.services.yubikey-touch-detector = { + systemd.services.yubikey-touch-detector = { enable = true; description = "Detects when your YubiKey is waiting for a touch"; - path = with pkgs; [ yubikey-touch-detector ]; - script = ''exec yubikey-touch-detector --notify''; + path = with pkgs; [ + gnupg + yubikey-touch-detector + ]; + wantedBy = [ + "graphical-session.target" + ]; + script = ''exec yubikey-touch-detector --libnotify''; environment.YUBIKEY_TOUCH_DETECTOR_LIBNOTIFY = "true"; }; };