31 lines
886 B
Nix
31 lines
886 B
Nix
{ nixosConfig, config, lib, pkgs, ... }:
|
|
|
|
{
|
|
systemd.user.services.yubikey-touch-detector = {
|
|
Unit = {
|
|
PartOf = [ "sway-session.target" ];
|
|
Description = "Detects when your YubiKey is waiting for a touch";
|
|
Requires = "yubikey-touch-detector.socket";
|
|
};
|
|
|
|
Install = {
|
|
WantedBy = [ "sway-session.target" ];
|
|
Also = "yubikey-touch-detector.socket";
|
|
};
|
|
|
|
Service = {
|
|
Environment = "YUBIKEY_TOUCH_DETECTOR_LIBNOTIFY=true";
|
|
ExecStart = "${pkgs.yubikey-touch-detector}/bin/yubikey-touch-detector";
|
|
Restart = "on-failure";
|
|
};
|
|
};
|
|
|
|
systemd.user.sockets.yubikey-touch-detector = {
|
|
Unit.Description = "Unix socket activation for YubiKey touch detector service";
|
|
Socket = {
|
|
ListenStream = "%t/yubikey-touch-detector.socket";
|
|
RemoveOnStop = "yes";
|
|
};
|
|
Install.WantedBy = [ "sockets.target" ];
|
|
};
|
|
}
|