chore: run formatter
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let cfg = config.services.yubikey-touch-detector;
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.services.yubikey-touch-detector;
|
||||
in {
|
||||
options.services.yubikey-touch-detector = {
|
||||
enable = mkEnableOption
|
||||
enable =
|
||||
mkEnableOption
|
||||
"a tool to detect when your YubiKey is waiting for a touch";
|
||||
|
||||
package = mkOption {
|
||||
@@ -22,7 +26,7 @@ in {
|
||||
|
||||
extraArgs = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ "--libnotify" ];
|
||||
default = ["--libnotify"];
|
||||
defaultText = literalExpression ''[ "--libnotify" ]'';
|
||||
description = ''
|
||||
Extra arguments to pass to the tool. The arguments are not escaped.
|
||||
@@ -31,20 +35,19 @@ in {
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
home.packages = [cfg.package];
|
||||
|
||||
# Service description licensed under ISC
|
||||
# See https://github.com/maximbaz/yubikey-touch-detector/blob/c9fdff7163361d6323e2de0449026710cacbc08a/LICENSE
|
||||
# Author: Maxim Baz
|
||||
systemd.user.sockets.yubikey-touch-detector = mkIf cfg.socket.enable {
|
||||
Unit.Description =
|
||||
"Unix socket activation for YubiKey touch detector service";
|
||||
Unit.Description = "Unix socket activation for YubiKey touch detector service";
|
||||
Socket = {
|
||||
ListenFIFO = "%t/yubikey-touch-detector.sock";
|
||||
RemoveOnStop = true;
|
||||
SocketMode = "0660";
|
||||
};
|
||||
Install.WantedBy = [ "sockets.target" ];
|
||||
Install.WantedBy = ["sockets.target"];
|
||||
};
|
||||
|
||||
# Same license thing for the description here
|
||||
@@ -52,19 +55,19 @@ in {
|
||||
Unit = {
|
||||
Description = "Detects when your YubiKey is waiting for a touch";
|
||||
Requires =
|
||||
optionals cfg.socket.enable [ "yubikey-touch-detector.socket" ];
|
||||
optionals cfg.socket.enable ["yubikey-touch-detector.socket"];
|
||||
};
|
||||
Service = {
|
||||
ExecStart = "${cfg.package}/bin/yubikey-touch-detector ${
|
||||
concatStringsSep " " cfg.extraArgs
|
||||
}";
|
||||
Environment = [ "PATH=${lib.makeBinPath [ pkgs.gnupg ]}" ];
|
||||
concatStringsSep " " cfg.extraArgs
|
||||
}";
|
||||
Environment = ["PATH=${lib.makeBinPath [pkgs.gnupg]}"];
|
||||
Restart = "on-failure";
|
||||
RestartSec = "1sec";
|
||||
};
|
||||
Install.Also =
|
||||
optionals cfg.socket.enable [ "yubikey-touch-detector.socket" ];
|
||||
Install.WantedBy = [ "default.target" ];
|
||||
optionals cfg.socket.enable ["yubikey-touch-detector.socket"];
|
||||
Install.WantedBy = ["default.target"];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user