Files
nixpkgs/nixos/modules/programs/yubikey-touch-detector.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

65 lines
1.5 KiB
Nix

{
config,
lib,
pkgs,
...
}:
let
inherit (lib) types;
cfg = config.programs.yubikey-touch-detector;
in
{
options = {
programs.yubikey-touch-detector = {
enable = lib.mkEnableOption "yubikey-touch-detector";
libnotify = lib.mkOption {
# This used to be true previously and using libnotify would be a sane default.
default = true;
type = types.bool;
description = ''
If set to true, yubikey-touch-detctor will send notifications using libnotify
'';
};
unixSocket = lib.mkOption {
default = true;
type = types.bool;
description = ''
If set to true, yubikey-touch-detector will send notifications to a unix socket
'';
};
verbose = lib.mkOption {
default = false;
type = types.bool;
description = ''
Enables verbose logging
'';
};
};
};
config = lib.mkIf cfg.enable {
systemd.packages = [ pkgs.yubikey-touch-detector ];
systemd.user.services.yubikey-touch-detector = {
path = [ pkgs.gnupg ];
environment = {
YUBIKEY_TOUCH_DETECTOR_LIBNOTIFY = builtins.toString cfg.libnotify;
YUBIKEY_TOUCH_DETECTOR_NOSOCKET = builtins.toString (!cfg.unixSocket);
YUBIKEY_TOUCH_DETECTOR_VERBOSE = builtins.toString cfg.verbose;
};
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
};
systemd.user.sockets.yubikey-touch-detector = {
wantedBy = [ "sockets.target" ];
};
};
}