File tree Expand file tree Collapse file tree 3 files changed +72
-16
lines changed Expand file tree Collapse file tree 3 files changed +72
-16
lines changed Original file line number Diff line number Diff line change 870
870
./services/misc/weechat.nix
871
871
./services/misc/workout-tracker.nix
872
872
./services/misc/xmrig.nix
873
+ ./services/misc/yubikey-touch-detector.nix
873
874
./services/misc/zoneminder.nix
874
875
./services/misc/zookeeper.nix
875
876
./services/monitoring/alerta.nix
Original file line number Diff line number Diff line change 43
43
} ;
44
44
45
45
config = lib . mkIf cfg . enable {
46
- systemd . packages = [ pkgs . yubikey-touch-detector ] ;
47
-
48
- systemd . user . services . yubikey-touch-detector = {
49
- path = [ pkgs . gnupg ] ;
50
-
51
- environment = {
52
- YUBIKEY_TOUCH_DETECTOR_LIBNOTIFY = builtins . toString cfg . libnotify ;
53
- YUBIKEY_TOUCH_DETECTOR_NOSOCKET = builtins . toString ( ! cfg . unixSocket ) ;
54
- YUBIKEY_TOUCH_DETECTOR_VERBOSE = builtins . toString cfg . verbose ;
55
- } ;
56
-
57
- wantedBy = [ "graphical-session.target" ] ;
58
- } ;
59
- systemd . user . sockets . yubikey-touch-detector = {
60
- wantedBy = [ "sockets.target" ] ;
61
- } ;
46
+ services . yubikey-touch-detector = cfg ;
47
+
48
+ warnings = [
49
+ ''
50
+ The module programs.yubikey-touch-detector is deprecated.
51
+ Please use services.yubikey-touch-detector instead.
52
+ ''
53
+ ] ;
62
54
} ;
63
55
}
Original file line number Diff line number Diff line change
1
+ {
2
+ config ,
3
+ lib ,
4
+ pkgs ,
5
+ ...
6
+ } :
7
+ let
8
+ inherit ( lib ) types ;
9
+ cfg = config . services . yubikey-touch-detector ;
10
+ in
11
+ {
12
+ options . services . yubikey-touch-detector = {
13
+
14
+ enable = lib . mkEnableOption "yubikey-touch-detector" ;
15
+
16
+ package = lib . mkPackageOption pkgs "yubikey-touch-detector" { } ;
17
+
18
+ libnotify = lib . mkOption {
19
+ # This used to be true previously and using libnotify would be a sane default.
20
+ default = true ;
21
+ type = types . bool ;
22
+ description = ''
23
+ If set to true, yubikey-touch-detctor will send notifications using libnotify
24
+ '' ;
25
+ } ;
26
+
27
+ unixSocket = lib . mkOption {
28
+ default = true ;
29
+ type = types . bool ;
30
+ description = ''
31
+ If set to true, yubikey-touch-detector will send notifications to a unix socket
32
+ '' ;
33
+ } ;
34
+
35
+ verbose = lib . mkOption {
36
+ default = false ;
37
+ type = types . bool ;
38
+ description = ''
39
+ Enables verbose logging
40
+ '' ;
41
+ } ;
42
+
43
+ } ;
44
+
45
+ config = lib . mkIf cfg . enable {
46
+ systemd . packages = [ cfg . package ] ;
47
+
48
+ systemd . user . services . yubikey-touch-detector = {
49
+ path = [ pkgs . gnupg ] ;
50
+
51
+ environment = {
52
+ YUBIKEY_TOUCH_DETECTOR_LIBNOTIFY = builtins . toString cfg . libnotify ;
53
+ YUBIKEY_TOUCH_DETECTOR_NOSOCKET = builtins . toString ( ! cfg . unixSocket ) ;
54
+ YUBIKEY_TOUCH_DETECTOR_VERBOSE = builtins . toString cfg . verbose ;
55
+ } ;
56
+
57
+ wantedBy = [ "graphical-session.target" ] ;
58
+ } ;
59
+ systemd . user . sockets . yubikey-touch-detector = {
60
+ wantedBy = [ "sockets.target" ] ;
61
+ } ;
62
+ } ;
63
+ }
You can’t perform that action at this time.
0 commit comments