mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-22 02:09:39 +01:00
screen-locker: add lockCmdEnv option (#6592)
This commit is contained in:
parent
c630dfa8ab
commit
5871e21c11
3 changed files with 13 additions and 0 deletions
|
|
@ -31,6 +31,14 @@ in {
|
||||||
example = "\${pkgs.i3lock}/bin/i3lock -n -c 000000";
|
example = "\${pkgs.i3lock}/bin/i3lock -n -c 000000";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
lockCmdEnv = lib.mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
default = [ ];
|
||||||
|
example = [ "XSECURELOCK_PAM_SERVICE=xsecurelock" ];
|
||||||
|
description =
|
||||||
|
"Environment variables to source a with the locker command (lockCmd).";
|
||||||
|
};
|
||||||
|
|
||||||
inactiveInterval = mkOption {
|
inactiveInterval = mkOption {
|
||||||
type = types.int;
|
type = types.int;
|
||||||
default = 10;
|
default = 10;
|
||||||
|
|
@ -127,6 +135,7 @@ in {
|
||||||
ExecStart = concatStringsSep " "
|
ExecStart = concatStringsSep " "
|
||||||
([ "${cfg.xss-lock.package}/bin/xss-lock" "-s \${XDG_SESSION_ID}" ]
|
([ "${cfg.xss-lock.package}/bin/xss-lock" "-s \${XDG_SESSION_ID}" ]
|
||||||
++ cfg.xss-lock.extraOptions ++ [ "-- ${cfg.lockCmd}" ]);
|
++ cfg.xss-lock.extraOptions ++ [ "-- ${cfg.lockCmd}" ]);
|
||||||
|
Environment = cfg.lockCmdEnv;
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
inactiveInterval = 5;
|
inactiveInterval = 5;
|
||||||
lockCmd = "${pkgs.i3lock}/bin/i3lock -n -c AA0000";
|
lockCmd = "${pkgs.i3lock}/bin/i3lock -n -c AA0000";
|
||||||
|
lockCmdEnv = [ "DISPLAY=:0" "XAUTHORITY=/custom/path/.Xauthority" ];
|
||||||
xss-lock = { extraOptions = [ "-test" ]; };
|
xss-lock = { extraOptions = [ "-test" ]; };
|
||||||
xautolock = {
|
xautolock = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
@ -19,6 +20,8 @@
|
||||||
|
|
||||||
assertFileExists $xssService
|
assertFileExists $xssService
|
||||||
assertFileRegex $xssService 'ExecStart=.*/bin/xss-lock.*-test.*i3lock -n -c AA0000'
|
assertFileRegex $xssService 'ExecStart=.*/bin/xss-lock.*-test.*i3lock -n -c AA0000'
|
||||||
|
assertFileRegex $xssService 'Environment=DISPLAY=:0'
|
||||||
|
assertFileRegex $xssService 'Environment=XAUTHORITY=/custom/path/.Xauthority'
|
||||||
assertFileRegex $xssService 'Restart=always'
|
assertFileRegex $xssService 'Restart=always'
|
||||||
assertFileExists $xautolockService
|
assertFileExists $xautolockService
|
||||||
assertFileRegex $xautolockService 'ExecStart=.*/bin/xautolock.*-time 5.*-detectsleep.*-test.*'
|
assertFileRegex $xautolockService 'ExecStart=.*/bin/xautolock.*-time 5.*-detectsleep.*-test.*'
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
inactiveInterval = 5;
|
inactiveInterval = 5;
|
||||||
lockCmd = "${pkgs.i3lock}/bin/i3lock -n -c AA0000";
|
lockCmd = "${pkgs.i3lock}/bin/i3lock -n -c AA0000";
|
||||||
|
lockCmdEnv = [ "DISPLAY=:0" "XAUTHORITY=/custom/path/.Xauthority" ];
|
||||||
xssLockExtraOptions = [ "-test" ];
|
xssLockExtraOptions = [ "-test" ];
|
||||||
xautolockExtraOptions = [ "-test" ];
|
xautolockExtraOptions = [ "-test" ];
|
||||||
enableDetectSleep = true;
|
enableDetectSleep = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue