9 cfg = config.programs.yubikey-touch-detector;
13 programs.yubikey-touch-detector = {
15 enable = lib.mkEnableOption "yubikey-touch-detector";
17 libnotify = lib.mkOption {
18 # This used to be true previously and using libnotify would be a sane default.
22 If set to true, yubikey-touch-detctor will send notifications using libnotify
26 unixSocket = lib.mkOption {
30 If set to true, yubikey-touch-detector will send notifications to a unix socket
34 verbose = lib.mkOption {
38 Enables verbose logging
45 config = lib.mkIf cfg.enable {
46 systemd.packages = [ pkgs.yubikey-touch-detector ];
48 systemd.user.services.yubikey-touch-detector = {
49 path = [ pkgs.gnupg ];
52 YUBIKEY_TOUCH_DETECTOR_LIBNOTIFY = builtins.toString cfg.libnotify;
53 YUBIKEY_TOUCH_DETECTOR_NOSOCKET = builtins.toString (!cfg.unixSocket);
54 YUBIKEY_TOUCH_DETECTOR_VERBOSE = builtins.toString cfg.verbose;
57 wantedBy = [ "graphical-session.target" ];
59 systemd.user.sockets.yubikey-touch-detector = {
60 wantedBy = [ "sockets.target" ];