diff options
author | Maximilian Bosch <maximilian@mbosch.me> | 2019-05-12 03:20:44 +0200 |
---|---|---|
committer | Maximilian Bosch <maximilian@mbosch.me> | 2019-05-12 03:20:44 +0200 |
commit | 775146165d0161210414566e28e18e3ac021f036 (patch) | |
tree | d78d4e72b3427f4e45726dc469b2567c226d6321 /nixos/modules/programs/xss-lock.nix | |
parent | 7fef2e38eab89caad8e9be93079a3fd51cf479f8 (diff) |
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.
Diffstat (limited to 'nixos/modules/programs/xss-lock.nix')
-rw-r--r-- | nixos/modules/programs/xss-lock.nix | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/programs/xss-lock.nix b/nixos/modules/programs/xss-lock.nix index 24aed58cd2ab..070463311db5 100644 --- a/nixos/modules/programs/xss-lock.nix +++ b/nixos/modules/programs/xss-lock.nix @@ -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 ]); |