From 9a5916dc478c4d3f3d191a98b537eb31c2f22311 Mon Sep 17 00:00:00 2001 From: Renzo Carbonara Date: Mon, 1 May 2017 17:09:45 +0200 Subject: [PATCH] tarsnap service: add 'verbose' config option (#25353) --- nixos/modules/services/backup/tarsnap.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/backup/tarsnap.nix b/nixos/modules/services/backup/tarsnap.nix index 67112343c335..7c9dedb67ad2 100644 --- a/nixos/modules/services/backup/tarsnap.nix +++ b/nixos/modules/services/backup/tarsnap.nix @@ -230,6 +230,14 @@ in Download bandwidth rate limit in bytes. ''; }; + + verbose = mkOption { + type = types.bool; + default = false; + description = '' + Whether to produce verbose logging output. + ''; + }; }; } )); @@ -293,7 +301,10 @@ in ''; script = - let run = ''tarsnap --configfile "/etc/tarsnap/${name}.conf" -c -f "${name}-$(date +"%Y%m%d%H%M%S")" ${concatStringsSep " " cfg.directories}''; + let run = ''tarsnap --configfile "/etc/tarsnap/${name}.conf" \ + -c -f "${name}-$(date +"%Y%m%d%H%M%S")" \ + ${optionalString cfg.verbose "-v"} \ + ${concatStringsSep " " cfg.directories}''; in if (cfg.cachedir != null) then '' mkdir -p ${cfg.cachedir} chmod 0700 ${cfg.cachedir}