about summary refs log tree commit diff
path: root/nixos/modules/programs/yubikey-touch-detector.nix
blob: 9a0d107f73c9837399283579d3b2ae7181cf1533 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{ config, lib, pkgs, ... }:
let cfg = config.programs.yubikey-touch-detector;
in {
  options = {
    programs.yubikey-touch-detector = {
      enable = lib.mkEnableOption "yubikey-touch-detector";
    };
  };

  config = lib.mkIf cfg.enable {
    systemd.packages = [ pkgs.yubikey-touch-detector ];

    systemd.user.services.yubikey-touch-detector = {
      path = [ pkgs.gnupg ];
      wantedBy = [ "graphical-session.target" ];
    };
    systemd.user.sockets.yubikey-touch-detector = {
      wantedBy = [ "sockets.target" ];
    };
  };
}