From 00b1cde808382820f4e289bcafb34c9e1c9cd6b6 Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Tue, 2 May 2023 16:32:52 -0400 Subject: [PATCH] borgmatic: make dependency on systemd conditional --- pkgs/tools/backup/borgmatic/default.nix | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/backup/borgmatic/default.nix b/pkgs/tools/backup/borgmatic/default.nix index 53cb506992ab..db88c6a05989 100644 --- a/pkgs/tools/backup/borgmatic/default.nix +++ b/pkgs/tools/backup/borgmatic/default.nix @@ -1,4 +1,14 @@ -{ borgbackup, coreutils, lib, python3Packages, systemd, installShellFiles, borgmatic, testers }: +{ lib +, stdenv +, borgbackup +, coreutils +, python3Packages +, systemd +, enableSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd +, installShellFiles +, borgmatic +, testers +}: python3Packages.buildPythonApplication rec { pname = "borgmatic"; @@ -31,7 +41,7 @@ python3Packages.buildPythonApplication rec { postInstall = '' installShellCompletion --cmd borgmatic \ --bash <($out/bin/borgmatic --bash-completion) - + '' + lib.optionalString enableSystemd '' 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