nixos/xss-lock: improve module
* Don't use `literalExample`, raw Nix values can directly be specified as an option example which provides support for highlighting in the manual as well. * Escape shell args for `extraOptions`: I.e. the `-n` option might be problematic as a longer notification command might be misinterpreted.
This commit is contained in:
parent
7fef2e38ea
commit
775146165d
1 changed files with 2 additions and 2 deletions
|
@ -18,7 +18,7 @@ in
|
|||
|
||||
extraOptions = mkOption {
|
||||
default = [ ];
|
||||
example = literalExample [ "--ignore-sleep" ];
|
||||
example = [ "--ignore-sleep" ];
|
||||
type = types.listOf types.str;
|
||||
description = ''
|
||||
Additional command-line arguments to pass to
|
||||
|
@ -35,7 +35,7 @@ in
|
|||
serviceConfig.ExecStart = with lib;
|
||||
strings.concatStringsSep " " ([
|
||||
"${pkgs.xss-lock}/bin/xss-lock"
|
||||
] ++ cfg.extraOptions ++ [
|
||||
] ++ (map escapeShellArg cfg.extraOptions) ++ [
|
||||
"--"
|
||||
cfg.lockerCommand
|
||||
]);
|
||||
|
|
Loading…
Reference in a new issue