Commit 5871e21 1 parent c630dfa commit 5871e21 Copy full SHA for 5871e21
File tree 3 files changed +13
-0
lines changed
tests/modules/services/screen-locker
3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 31
31
example = "\ ${pkgs.i3lock}/bin/i3lock -n -c 000000" ;
32
32
} ;
33
33
34
+ lockCmdEnv = lib . mkOption {
35
+ type = types . listOf types . str ;
36
+ default = [ ] ;
37
+ example = [ "XSECURELOCK_PAM_SERVICE=xsecurelock" ] ;
38
+ description =
39
+ "Environment variables to source a with the locker command (lockCmd)." ;
40
+ } ;
41
+
34
42
inactiveInterval = mkOption {
35
43
type = types . int ;
36
44
default = 10 ;
127
135
ExecStart = concatStringsSep " "
128
136
( [ "${ cfg . xss-lock . package } /bin/xss-lock" "-s \ ${XDG_SESSION_ID}" ]
129
137
++ cfg . xss-lock . extraOptions ++ [ "-- ${ cfg . lockCmd } " ] ) ;
138
+ Environment = cfg . lockCmdEnv ;
130
139
Restart = "always" ;
131
140
} ;
132
141
} ;
Original file line number Diff line number Diff line change 5
5
enable = true ;
6
6
inactiveInterval = 5 ;
7
7
lockCmd = "${ pkgs . i3lock } /bin/i3lock -n -c AA0000" ;
8
+ lockCmdEnv = [ "DISPLAY=:0" "XAUTHORITY=/custom/path/.Xauthority" ] ;
8
9
xss-lock = { extraOptions = [ "-test" ] ; } ;
9
10
xautolock = {
10
11
enable = true ;
19
20
20
21
assertFileExists $xssService
21
22
assertFileRegex $xssService 'ExecStart=.*/bin/xss-lock.*-test.*i3lock -n -c AA0000'
23
+ assertFileRegex $xssService 'Environment=DISPLAY=:0'
24
+ assertFileRegex $xssService 'Environment=XAUTHORITY=/custom/path/.Xauthority'
22
25
assertFileRegex $xssService 'Restart=always'
23
26
assertFileExists $xautolockService
24
27
assertFileRegex $xautolockService 'ExecStart=.*/bin/xautolock.*-time 5.*-detectsleep.*-test.*'
Original file line number Diff line number Diff line change 5
5
enable = true ;
6
6
inactiveInterval = 5 ;
7
7
lockCmd = "${ pkgs . i3lock } /bin/i3lock -n -c AA0000" ;
8
+ lockCmdEnv = [ "DISPLAY=:0" "XAUTHORITY=/custom/path/.Xauthority" ] ;
8
9
xssLockExtraOptions = [ "-test" ] ;
9
10
xautolockExtraOptions = [ "-test" ] ;
10
11
enableDetectSleep = true ;
You can’t perform that action at this time.
0 commit comments