From 7cb7c57132d65c60af0ded8cfb1d57ae690730e1 Mon Sep 17 00:00:00 2001 From: Joachim Fasting Date: Sat, 4 Apr 2015 11:33:05 +0200 Subject: [PATCH] tarsnap module: inline optionalNullStr --- nixos/modules/services/backup/tarsnap.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nixos/modules/services/backup/tarsnap.nix b/nixos/modules/services/backup/tarsnap.nix index 155161945cd9..87066b9459f1 100644 --- a/nixos/modules/services/backup/tarsnap.nix +++ b/nixos/modules/services/backup/tarsnap.nix @@ -5,15 +5,13 @@ with lib; let cfg = config.services.tarsnap; - optionalNullStr = e: v: if e == null then "" else v; - configFile = cfg: '' cachedir ${config.services.tarsnap.cachedir} keyfile ${config.services.tarsnap.keyfile} ${optionalString cfg.nodump "nodump"} ${optionalString cfg.printStats "print-stats"} ${optionalString cfg.printStats "humanize-numbers"} - ${optionalNullStr cfg.checkpointBytes "checkpoint-bytes "+cfg.checkpointBytes} + ${optionalString (cfg.checkpointBytes != null) ("checkpoint-bytes "+cfg.checkpointBytes)} ${optionalString cfg.aggressiveNetworking "aggressive-networking"} ${concatStringsSep "\n" (map (v: "exclude "+v) cfg.excludes)} ${concatStringsSep "\n" (map (v: "include "+v) cfg.includes)}