diff options
author | Maximilian Bosch <maximilian@mbosch.me> | 2019-05-12 11:07:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-12 11:07:54 +0200 |
commit | fa2c6dc3c2317f76e4253dab0b460a3cc0c30cad (patch) | |
tree | 617caf215351ada75ed2e8606815329700e160dd /nixos/modules | |
parent | 74c841f4ad51578cc515e1c427b40ed6c7a29f4c (diff) | |
parent | d27431b362d8ad3d745989299d52640e4ce9863e (diff) |
Merge pull request #61311 from turboMaCk/xss-lock-locker-options
xss-lock: improve locker options passing
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/programs/xss-lock.nix | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/nixos/modules/programs/xss-lock.nix b/nixos/modules/programs/xss-lock.nix index c290df01b960..070463311db5 100644 --- a/nixos/modules/programs/xss-lock.nix +++ b/nixos/modules/programs/xss-lock.nix @@ -8,12 +8,23 @@ in { options.programs.xss-lock = { enable = mkEnableOption "xss-lock"; + lockerCommand = mkOption { default = "${pkgs.i3lock}/bin/i3lock"; example = literalExample ''''${pkgs.i3lock-fancy}/bin/i3lock-fancy''; type = types.string; description = "Locker to be used with xsslock"; }; + + extraOptions = mkOption { + default = [ ]; + example = [ "--ignore-sleep" ]; + type = types.listOf types.str; + description = '' + Additional command-line arguments to pass to + <command>xss-lock</command>. + ''; + }; }; config = mkIf cfg.enable { @@ -21,7 +32,13 @@ in description = "XSS Lock Daemon"; wantedBy = [ "graphical-session.target" ]; partOf = [ "graphical-session.target" ]; - serviceConfig.ExecStart = "${pkgs.xss-lock}/bin/xss-lock ${cfg.lockerCommand}"; + serviceConfig.ExecStart = with lib; + strings.concatStringsSep " " ([ + "${pkgs.xss-lock}/bin/xss-lock" + ] ++ (map escapeShellArg cfg.extraOptions) ++ [ + "--" + cfg.lockerCommand + ]); }; }; } |