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.
This commit is contained in:
Florian Klink 2019-06-02 23:12:01 +02:00 committed by Robert Helgesson
parent 2211770d8b
commit 8991fe2e90
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -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);
};
};