summary refs log tree commit diff
path: root/nixos/modules/services/backup
diff options
context:
space:
mode:
authorRenzo Carbonara <k0001@users.noreply.github.com>2017-05-01 17:09:45 +0200
committerJoachim F <joachifm@users.noreply.github.com>2017-05-01 16:09:45 +0100
commit9a5916dc478c4d3f3d191a98b537eb31c2f22311 (patch)
treef52f0da9121794170b64f876dd57254fb94f0874 /nixos/modules/services/backup
parentb69d04c79807e54340ebe1ce84731c21bf9df276 (diff)
downloadnixpkgs-9a5916dc478c4d3f3d191a98b537eb31c2f22311.tar
nixpkgs-9a5916dc478c4d3f3d191a98b537eb31c2f22311.tar.gz
nixpkgs-9a5916dc478c4d3f3d191a98b537eb31c2f22311.tar.bz2
nixpkgs-9a5916dc478c4d3f3d191a98b537eb31c2f22311.tar.lz
nixpkgs-9a5916dc478c4d3f3d191a98b537eb31c2f22311.tar.xz
nixpkgs-9a5916dc478c4d3f3d191a98b537eb31c2f22311.tar.zst
nixpkgs-9a5916dc478c4d3f3d191a98b537eb31c2f22311.zip
tarsnap service: add 'verbose' config option (#25353)
Diffstat (limited to 'nixos/modules/services/backup')
-rw-r--r--nixos/modules/services/backup/tarsnap.nix13
1 files changed, 12 insertions, 1 deletions
diff --git a/nixos/modules/services/backup/tarsnap.nix b/nixos/modules/services/backup/tarsnap.nix
index 67112343c33..7c9dedb67ad 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}