From 775146165d0161210414566e28e18e3ac021f036 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sun, 12 May 2019 03:20:44 +0200 Subject: 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. --- nixos/modules/programs/xss-lock.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nixos/modules') 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 ]); -- cgit 1.4.1