From 41c442a4edc7598826b8d13a8decadc6d17b30af Mon Sep 17 00:00:00 2001 From: sefidel Date: Sat, 10 Aug 2024 16:00:14 +0900 Subject: feat(home/security): configure yubikey-touch-detector --- home/profiles/security/default.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'home') diff --git a/home/profiles/security/default.nix b/home/profiles/security/default.nix index 3ff6a2e..b6842df 100644 --- a/home/profiles/security/default.nix +++ b/home/profiles/security/default.nix @@ -19,5 +19,31 @@ in pkgs.protonvpn-gui ]; + + systemd.user = lib.mkIf pkgs.stdenv.isLinux { + 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" ]; + }; + + 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" ]; + }; + }; + }; }; } -- cgit 1.4.1