From fd531d2f826517dfc7cfa6e5254a740e04d07be1 Mon Sep 17 00:00:00 2001 From: Fabian Hauser Date: Wed, 5 Jun 2024 16:39:38 +0200 Subject: [PATCH] Add yubikey touch indicator --- home/fhauser/applications/gpg.nix | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/home/fhauser/applications/gpg.nix b/home/fhauser/applications/gpg.nix index c5388a0..f72d28f 100644 --- a/home/fhauser/applications/gpg.nix +++ b/home/fhauser/applications/gpg.nix @@ -1,4 +1,4 @@ -{ pkgs, pkgsUnstable, ... }: +{ pkgs, pkgsUnstable, lib, ... }: { #TODO: ENV variabls for agent programs.gpg = { @@ -56,4 +56,28 @@ "638143D3F6421377E9D4C7F1D2EDC5AA0A860351" # 0x3E957C9C8CB5D6B2 / fabian.hauser@qo.is ]; }; + + systemd.user.sockets.yubikey-touch-detector = { + Unit.Description = "Unix socket activation for YubiKey touch detector service"; + Socket = { + ListenStream = "%t/yubikey-touch-detector.socket"; + RemoveOnStop = true; + }; + Install.WantedBy = [ "sockets.target" ]; + }; + + systemd.user.services.yubikey-touch-detector = { + Unit = { + Description = "Detects when your YubiKey is waiting for a touch"; + Requires = "yubikey-touch-detector.socket"; + }; + Service = { + ExecStart = "${lib.getExe pkgs.yubikey-touch-detector} --libnotify"; + EnvironmentFile = "-%E/yubikey-touch-detector/service.conf"; + }; + Install = { + Also = "yubikey-touch-detector.socket"; + WantedBy = [ "default.target" ]; + }; + }; }