summary refs log tree commit diff
diff options
context:
space:
mode:
authorMarek Fajkus <marek.faj@gmail.com>2019-05-11 18:56:48 +0200
committerMarek Fajkus <marek.faj@gmail.com>2019-05-11 19:33:10 +0200
commit7fef2e38eab89caad8e9be93079a3fd51cf479f8 (patch)
treeda003bd0900f665bfee86efdce5524d764f837c6
parentbc94dcf500286495e3c478a9f9322debc94c4304 (diff)
downloadnixpkgs-7fef2e38eab89caad8e9be93079a3fd51cf479f8.tar
nixpkgs-7fef2e38eab89caad8e9be93079a3fd51cf479f8.tar.gz
nixpkgs-7fef2e38eab89caad8e9be93079a3fd51cf479f8.tar.bz2
nixpkgs-7fef2e38eab89caad8e9be93079a3fd51cf479f8.tar.lz
nixpkgs-7fef2e38eab89caad8e9be93079a3fd51cf479f8.tar.xz
nixpkgs-7fef2e38eab89caad8e9be93079a3fd51cf479f8.tar.zst
nixpkgs-7fef2e38eab89caad8e9be93079a3fd51cf479f8.zip
xss-locker: improve options passing
- allow locker options without hacks
- add extraOptions
-rw-r--r--nixos/modules/programs/xss-lock.nix19
1 files changed, 18 insertions, 1 deletions
diff --git a/nixos/modules/programs/xss-lock.nix b/nixos/modules/programs/xss-lock.nix
index c290df01b96..24aed58cd2a 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 = literalExample [ "--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"
+          ] ++ cfg.extraOptions ++ [
+            "--"
+            cfg.lockerCommand
+        ]);
     };
   };
 }