From 9a3b1ec222ab2c2b947833ba008db85a94582ac7 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Sun, 29 Apr 2018 15:58:42 +0200 Subject: [PATCH] screen-locker: Add extraOptions for xss-lock and xautolock --- modules/services/screen-locker.nix | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/modules/services/screen-locker.nix b/modules/services/screen-locker.nix index 291416564..844075eee 100644 --- a/modules/services/screen-locker.nix +++ b/modules/services/screen-locker.nix @@ -26,6 +26,23 @@ in { See . ''; }; + + xautolockExtraOptions = mkOption { + type = types.listOf types.str; + default = []; + description = '' + Extra command-line arguments to pass to xautolock. + ''; + }; + + xssLockExtraOptions = mkOption { + type = types.listOf types.str; + default = []; + description = '' + Extra command-line arguments to pass to xss-lock. + ''; + }; + }; config = mkIf cfg.enable { @@ -45,7 +62,8 @@ in { ${pkgs.xautolock}/bin/xautolock \ -detectsleep \ -time ${toString cfg.inactiveInterval} \ - -locker '${pkgs.systemd}/bin/loginctl lock-session $XDG_SESSION_ID' + -locker '${pkgs.systemd}/bin/loginctl lock-session $XDG_SESSION_ID' \ + ${concatStringsSep " " cfg.xautolockExtraOptions} ''; }; }; @@ -53,7 +71,7 @@ in { # xss-lock will run specified screen locker when the session is locked via loginctl # can't be started as a systemd service, # see https://bitbucket.org/raymonad/xss-lock/issues/13/allow-operation-as-systemd-user-unit - xsession.initExtra = "${pkgs.xss-lock}/bin/xss-lock -- ${cfg.lockCmd} &"; + xsession.initExtra = "${pkgs.xss-lock}/bin/xss-lock ${concatStringsSep " " cfg.xssLockExtraOptions} -- ${cfg.lockCmd} &"; }; }