borgmatic: fix systemd service

due to 2e9f70d496
there is another "sleep", which is now wrongly substituted.

This fixes the error:
Failed to inhibit: Invalid what specification
/nix/store/if12v01xkqladifvk8yqjdpbp6sisg74-coreutils-9.1/bin/sleep:shutdown

Signed-off-by: Florian Brandes <florian.brandes@posteo.de>
This commit is contained in:
Florian Brandes 2023-03-02 08:00:10 +01:00 committed by Bjørn Forsman
parent 255f62ed45
commit 8281752e39

View file

@ -34,11 +34,13 @@ python3Packages.buildPythonApplication rec {
mkdir -p $out/lib/systemd/system
cp sample/systemd/borgmatic.timer $out/lib/systemd/system/
# there is another "sleep", so choose the one with the space after it
# due to https://github.com/borgmatic-collective/borgmatic/commit/2e9f70d49647d47fb4ca05f428c592b0e4319544
substitute sample/systemd/borgmatic.service \
$out/lib/systemd/system/borgmatic.service \
--replace /root/.local/bin/borgmatic $out/bin/borgmatic \
--replace systemd-inhibit ${systemd}/bin/systemd-inhibit \
--replace sleep ${coreutils}/bin/sleep
--replace "sleep " "${coreutils}/bin/sleep "
'';
passthru.tests.version = testers.testVersion { package = borgmatic; };