mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-02 13:00:23 +00:00
Remove optional builtins prefixes from prelude functions by running:
builtins=(
abort
baseNameOf
break
derivation
derivationStrict
dirOf
false
fetchGit
fetchMercurial
fetchTarball
fetchTree
fromTOML
import
isNull
map
null
placeholder
removeAttrs
scopedImport
throw
toString
true
)
fd \
--exclude doc/manual/release-notes \
--type file \
. \
nixos \
--exec-batch sed --in-place --regexp-extended "
s/\<builtins\.($(
printf '%s\n' "${builtins[@]}" |
paste --delimiter '|' --serial -
))\>/\1/g
"
nix fmt
65 lines
1.5 KiB
Nix
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 = toString cfg.libnotify;
|
|
YUBIKEY_TOUCH_DETECTOR_NOSOCKET = toString (!cfg.unixSocket);
|
|
YUBIKEY_TOUCH_DETECTOR_VERBOSE = toString cfg.verbose;
|
|
};
|
|
|
|
wantedBy = [ "graphical-session.target" ];
|
|
partOf = [ "graphical-session.target" ];
|
|
};
|
|
systemd.user.sockets.yubikey-touch-detector = {
|
|
wantedBy = [ "sockets.target" ];
|
|
};
|
|
};
|
|
}
|