From 8991fe2e90a9b35a98a8b98f02c9de5425b11785 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sun, 2 Jun 2019 23:12:01 +0200 Subject: [PATCH] screen-locker: fix systemd unit In particular, don't add trailing backslashes introduced by `xautolockExtraOptions`. Systemd's unit file parser seems to have gotten a bit stricter and with systemd 242, the trailing backslash caused the next non-empty line to be ignored. In that case, this was `[Section]`, so all subsequent settings were mistakenly added to `[Service]`, causing them to be ignored entirely. Simplify and fix this by using `concatStringsSep` to build a single `ExecStart` line. --- modules/services/screen-locker.nix | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/modules/services/screen-locker.nix b/modules/services/screen-locker.nix index 844075ee..e3da1406 100644 --- a/modules/services/screen-locker.nix +++ b/modules/services/screen-locker.nix @@ -58,13 +58,12 @@ in { }; Service = { - ExecStart = '' - ${pkgs.xautolock}/bin/xautolock \ - -detectsleep \ - -time ${toString cfg.inactiveInterval} \ - -locker '${pkgs.systemd}/bin/loginctl lock-session $XDG_SESSION_ID' \ - ${concatStringsSep " " cfg.xautolockExtraOptions} - ''; + ExecStart = concatStringsSep " " ([ + "${pkgs.xautolock}/bin/xautolock" + "-detectsleep" + "-time ${toString cfg.inactiveInterval}" + "-locker '${pkgs.systemd}/bin/loginctl lock-session $XDG_SESSION_ID'" + ] ++ cfg.xautolockExtraOptions); }; };